jolt 0.9.76__py3-none-any.whl → 0.9.429__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of jolt might be problematic. Click here for more details.
- jolt/__init__.py +88 -7
- jolt/__main__.py +9 -1
- jolt/bin/fstree-darwin-x86_64 +0 -0
- jolt/bin/fstree-linux-x86_64 +0 -0
- jolt/cache.py +839 -367
- jolt/chroot.py +156 -0
- jolt/cli.py +362 -143
- jolt/common_pb2.py +63 -0
- jolt/common_pb2_grpc.py +4 -0
- jolt/config.py +99 -42
- jolt/error.py +19 -4
- jolt/expires.py +2 -2
- jolt/filesystem.py +8 -6
- jolt/graph.py +705 -117
- jolt/hooks.py +63 -1
- jolt/influence.py +129 -6
- jolt/loader.py +369 -121
- jolt/log.py +225 -63
- jolt/manifest.py +28 -38
- jolt/options.py +35 -10
- jolt/pkgs/abseil.py +42 -0
- jolt/pkgs/asio.py +25 -0
- jolt/pkgs/autoconf.py +41 -0
- jolt/pkgs/automake.py +41 -0
- jolt/pkgs/b2.py +31 -0
- jolt/pkgs/boost.py +111 -0
- jolt/pkgs/boringssl.py +32 -0
- jolt/pkgs/busybox.py +39 -0
- jolt/pkgs/bzip2.py +43 -0
- jolt/pkgs/cares.py +29 -0
- jolt/pkgs/catch2.py +36 -0
- jolt/pkgs/cbindgen.py +17 -0
- jolt/pkgs/cista.py +19 -0
- jolt/pkgs/clang.py +44 -0
- jolt/pkgs/cli11.py +23 -0
- jolt/pkgs/cmake.py +48 -0
- jolt/pkgs/cpython.py +196 -0
- jolt/pkgs/crun.py +29 -0
- jolt/pkgs/curl.py +38 -0
- jolt/pkgs/dbus.py +18 -0
- jolt/pkgs/double_conversion.py +24 -0
- jolt/pkgs/fastfloat.py +21 -0
- jolt/pkgs/ffmpeg.py +28 -0
- jolt/pkgs/flatbuffers.py +29 -0
- jolt/pkgs/fmt.py +27 -0
- jolt/pkgs/fstree.py +20 -0
- jolt/pkgs/gflags.py +18 -0
- jolt/pkgs/glib.py +18 -0
- jolt/pkgs/glog.py +25 -0
- jolt/pkgs/glslang.py +21 -0
- jolt/pkgs/golang.py +16 -11
- jolt/pkgs/googlebenchmark.py +18 -0
- jolt/pkgs/googletest.py +46 -0
- jolt/pkgs/gperf.py +15 -0
- jolt/pkgs/grpc.py +73 -0
- jolt/pkgs/hdf5.py +19 -0
- jolt/pkgs/help2man.py +14 -0
- jolt/pkgs/inja.py +28 -0
- jolt/pkgs/jsoncpp.py +31 -0
- jolt/pkgs/libarchive.py +43 -0
- jolt/pkgs/libcap.py +44 -0
- jolt/pkgs/libdrm.py +44 -0
- jolt/pkgs/libedit.py +42 -0
- jolt/pkgs/libevent.py +31 -0
- jolt/pkgs/libexpat.py +27 -0
- jolt/pkgs/libfastjson.py +21 -0
- jolt/pkgs/libffi.py +16 -0
- jolt/pkgs/libglvnd.py +30 -0
- jolt/pkgs/libogg.py +28 -0
- jolt/pkgs/libpciaccess.py +18 -0
- jolt/pkgs/libseccomp.py +21 -0
- jolt/pkgs/libtirpc.py +24 -0
- jolt/pkgs/libtool.py +42 -0
- jolt/pkgs/libunwind.py +35 -0
- jolt/pkgs/libva.py +18 -0
- jolt/pkgs/libvorbis.py +33 -0
- jolt/pkgs/libxml2.py +35 -0
- jolt/pkgs/libxslt.py +17 -0
- jolt/pkgs/libyajl.py +16 -0
- jolt/pkgs/llvm.py +81 -0
- jolt/pkgs/lua.py +54 -0
- jolt/pkgs/lz4.py +26 -0
- jolt/pkgs/m4.py +14 -0
- jolt/pkgs/make.py +17 -0
- jolt/pkgs/mesa.py +81 -0
- jolt/pkgs/meson.py +17 -0
- jolt/pkgs/mstch.py +28 -0
- jolt/pkgs/mysql.py +60 -0
- jolt/pkgs/nasm.py +49 -0
- jolt/pkgs/ncurses.py +30 -0
- jolt/pkgs/ng_log.py +25 -0
- jolt/pkgs/ninja.py +45 -0
- jolt/pkgs/nlohmann_json.py +25 -0
- jolt/pkgs/nodejs.py +19 -11
- jolt/pkgs/opencv.py +24 -0
- jolt/pkgs/openjdk.py +26 -0
- jolt/pkgs/openssl.py +103 -0
- jolt/pkgs/paho.py +76 -0
- jolt/pkgs/patchelf.py +16 -0
- jolt/pkgs/perl.py +42 -0
- jolt/pkgs/pkgconfig.py +64 -0
- jolt/pkgs/poco.py +39 -0
- jolt/pkgs/protobuf.py +77 -0
- jolt/pkgs/pugixml.py +27 -0
- jolt/pkgs/python.py +19 -0
- jolt/pkgs/qt.py +35 -0
- jolt/pkgs/rapidjson.py +26 -0
- jolt/pkgs/rapidyaml.py +28 -0
- jolt/pkgs/re2.py +30 -0
- jolt/pkgs/re2c.py +17 -0
- jolt/pkgs/readline.py +15 -0
- jolt/pkgs/rust.py +41 -0
- jolt/pkgs/sdl.py +28 -0
- jolt/pkgs/simdjson.py +27 -0
- jolt/pkgs/soci.py +46 -0
- jolt/pkgs/spdlog.py +29 -0
- jolt/pkgs/spirv_llvm.py +21 -0
- jolt/pkgs/spirv_tools.py +24 -0
- jolt/pkgs/sqlite.py +83 -0
- jolt/pkgs/ssl.py +12 -0
- jolt/pkgs/texinfo.py +15 -0
- jolt/pkgs/tomlplusplus.py +22 -0
- jolt/pkgs/wayland.py +26 -0
- jolt/pkgs/x11.py +58 -0
- jolt/pkgs/xerces_c.py +20 -0
- jolt/pkgs/xorg.py +360 -0
- jolt/pkgs/xz.py +29 -0
- jolt/pkgs/yamlcpp.py +30 -0
- jolt/pkgs/zeromq.py +47 -0
- jolt/pkgs/zlib.py +69 -0
- jolt/pkgs/zstd.py +33 -0
- jolt/plugins/alias.py +3 -0
- jolt/plugins/allure.py +5 -2
- jolt/plugins/autotools.py +66 -0
- jolt/plugins/cache.py +133 -0
- jolt/plugins/cmake.py +74 -6
- jolt/plugins/conan.py +238 -0
- jolt/plugins/cxx.py +698 -0
- jolt/plugins/cxxinfo.py +7 -0
- jolt/plugins/dashboard.py +1 -1
- jolt/plugins/docker.py +91 -23
- jolt/plugins/email.py +5 -2
- jolt/plugins/email.xslt +144 -101
- jolt/plugins/environ.py +11 -0
- jolt/plugins/fetch.py +141 -0
- jolt/plugins/gdb.py +44 -21
- jolt/plugins/gerrit.py +1 -14
- jolt/plugins/git.py +316 -101
- jolt/plugins/googletest.py +522 -1
- jolt/plugins/http.py +36 -38
- jolt/plugins/libtool.py +63 -0
- jolt/plugins/linux.py +990 -0
- jolt/plugins/logstash.py +4 -4
- jolt/plugins/meson.py +61 -0
- jolt/plugins/ninja-compdb.py +107 -31
- jolt/plugins/ninja.py +929 -134
- jolt/plugins/paths.py +11 -1
- jolt/plugins/pkgconfig.py +219 -0
- jolt/plugins/podman.py +148 -91
- jolt/plugins/python.py +137 -0
- jolt/plugins/remote_execution/__init__.py +0 -0
- jolt/plugins/remote_execution/administration_pb2.py +46 -0
- jolt/plugins/remote_execution/administration_pb2_grpc.py +170 -0
- jolt/plugins/remote_execution/log_pb2.py +32 -0
- jolt/plugins/remote_execution/log_pb2_grpc.py +68 -0
- jolt/plugins/remote_execution/scheduler_pb2.py +41 -0
- jolt/plugins/remote_execution/scheduler_pb2_grpc.py +141 -0
- jolt/plugins/remote_execution/worker_pb2.py +38 -0
- jolt/plugins/remote_execution/worker_pb2_grpc.py +112 -0
- jolt/plugins/report.py +12 -2
- jolt/plugins/rust.py +25 -0
- jolt/plugins/scheduler.py +710 -0
- jolt/plugins/selfdeploy/setup.py +9 -4
- jolt/plugins/selfdeploy.py +138 -88
- jolt/plugins/strings.py +35 -22
- jolt/plugins/symlinks.py +26 -11
- jolt/plugins/telemetry.py +5 -2
- jolt/plugins/timeline.py +13 -3
- jolt/plugins/volume.py +46 -48
- jolt/scheduler.py +591 -191
- jolt/tasks.py +1783 -245
- jolt/templates/export.sh.template +12 -6
- jolt/templates/timeline.html.template +44 -47
- jolt/timer.py +22 -0
- jolt/tools.py +749 -302
- jolt/utils.py +245 -18
- jolt/version.py +1 -1
- jolt/version_utils.py +2 -2
- jolt/xmldom.py +12 -2
- {jolt-0.9.76.dist-info → jolt-0.9.429.dist-info}/METADATA +98 -38
- jolt-0.9.429.dist-info/RECORD +207 -0
- {jolt-0.9.76.dist-info → jolt-0.9.429.dist-info}/WHEEL +1 -1
- jolt/plugins/amqp.py +0 -834
- jolt/plugins/debian.py +0 -338
- jolt/plugins/ftp.py +0 -181
- jolt/plugins/ninja-cache.py +0 -64
- jolt/plugins/ninjacli.py +0 -271
- jolt/plugins/repo.py +0 -253
- jolt-0.9.76.dist-info/RECORD +0 -79
- {jolt-0.9.76.dist-info → jolt-0.9.429.dist-info}/entry_points.txt +0 -0
- {jolt-0.9.76.dist-info → jolt-0.9.429.dist-info}/top_level.txt +0 -0
jolt/hooks.py
CHANGED
|
@@ -8,6 +8,9 @@ class TaskHook(object):
|
|
|
8
8
|
def task_created(self, task):
|
|
9
9
|
pass
|
|
10
10
|
|
|
11
|
+
def task_queued(self, task):
|
|
12
|
+
pass
|
|
13
|
+
|
|
11
14
|
def task_started(self, task):
|
|
12
15
|
pass
|
|
13
16
|
|
|
@@ -36,6 +39,9 @@ class TaskHook(object):
|
|
|
36
39
|
def task_failed(self, task):
|
|
37
40
|
pass
|
|
38
41
|
|
|
42
|
+
def task_unstable(self, task):
|
|
43
|
+
pass
|
|
44
|
+
|
|
39
45
|
def task_pruned(self, task):
|
|
40
46
|
pass
|
|
41
47
|
|
|
@@ -95,6 +101,10 @@ class TaskHookRegistry(object):
|
|
|
95
101
|
for ext in self.hooks:
|
|
96
102
|
utils.call_and_catch_and_log(ext.task_created, task)
|
|
97
103
|
|
|
104
|
+
def task_queued(self, task):
|
|
105
|
+
for ext in self.hooks:
|
|
106
|
+
utils.call_and_catch_and_log(ext.task_queued, task)
|
|
107
|
+
|
|
98
108
|
def task_started(self, task):
|
|
99
109
|
if task.is_resource():
|
|
100
110
|
return
|
|
@@ -149,6 +159,12 @@ class TaskHookRegistry(object):
|
|
|
149
159
|
for ext in self.hooks:
|
|
150
160
|
utils.call_and_catch_and_log(ext.task_failed, task)
|
|
151
161
|
|
|
162
|
+
def task_unstable(self, task):
|
|
163
|
+
if task.is_resource():
|
|
164
|
+
return
|
|
165
|
+
for ext in self.hooks:
|
|
166
|
+
utils.call_and_catch_and_log(ext.task_unstable, task)
|
|
167
|
+
|
|
152
168
|
def task_pruned(self, task):
|
|
153
169
|
if task.is_resource():
|
|
154
170
|
return
|
|
@@ -199,7 +215,7 @@ class TaskHookRegistry(object):
|
|
|
199
215
|
|
|
200
216
|
@contextmanager
|
|
201
217
|
def task_run(self, task):
|
|
202
|
-
tasks = [task] if type(task)
|
|
218
|
+
tasks = [task] if type(task) is not list else task
|
|
203
219
|
with ExitStack() as stack:
|
|
204
220
|
for task in tasks:
|
|
205
221
|
if task.is_resource():
|
|
@@ -218,6 +234,14 @@ class CliHook(object):
|
|
|
218
234
|
def cli_clean(self, *args, **kwargs):
|
|
219
235
|
yield
|
|
220
236
|
|
|
237
|
+
@contextmanager
|
|
238
|
+
def cli_download(self, *args, **kwargs):
|
|
239
|
+
yield
|
|
240
|
+
|
|
241
|
+
@contextmanager
|
|
242
|
+
def cli_report(self, *args, **kwargs):
|
|
243
|
+
yield
|
|
244
|
+
|
|
221
245
|
|
|
222
246
|
class CliHookFactory(object):
|
|
223
247
|
@staticmethod
|
|
@@ -251,11 +275,29 @@ class CliHookRegistry(object):
|
|
|
251
275
|
stack.enter_context(ext.cli_clean(*args, **kwargs))
|
|
252
276
|
yield
|
|
253
277
|
|
|
278
|
+
@contextmanager
|
|
279
|
+
def cli_download(self, *args, **kwargs):
|
|
280
|
+
with ExitStack() as stack:
|
|
281
|
+
for ext in self.hooks:
|
|
282
|
+
stack.enter_context(ext.cli_download(*args, **kwargs))
|
|
283
|
+
yield
|
|
284
|
+
|
|
285
|
+
@contextmanager
|
|
286
|
+
def cli_report(self, *args, **kwargs):
|
|
287
|
+
with ExitStack() as stack:
|
|
288
|
+
for ext in self.hooks:
|
|
289
|
+
stack.enter_context(ext.cli_report(*args, **kwargs))
|
|
290
|
+
yield
|
|
291
|
+
|
|
254
292
|
|
|
255
293
|
def task_created(task):
|
|
256
294
|
TaskHookRegistry.get().task_created(task)
|
|
257
295
|
|
|
258
296
|
|
|
297
|
+
def task_queued(task):
|
|
298
|
+
TaskHookRegistry.get().task_queued(task)
|
|
299
|
+
|
|
300
|
+
|
|
259
301
|
def task_started(task):
|
|
260
302
|
TaskHookRegistry.get().task_started(task)
|
|
261
303
|
|
|
@@ -276,6 +318,10 @@ def task_failed(task):
|
|
|
276
318
|
TaskHookRegistry.get().task_failed(task)
|
|
277
319
|
|
|
278
320
|
|
|
321
|
+
def task_unstable(task):
|
|
322
|
+
TaskHookRegistry.get().task_unstable(task)
|
|
323
|
+
|
|
324
|
+
|
|
279
325
|
def task_finished(task):
|
|
280
326
|
TaskHookRegistry.get().task_finished(task)
|
|
281
327
|
|
|
@@ -342,3 +388,19 @@ def cli_clean(cmd):
|
|
|
342
388
|
with CliHookRegistry.get().cli_clean():
|
|
343
389
|
return cmd(*args, **kwargs)
|
|
344
390
|
return decorator
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
def cli_download(cmd):
|
|
394
|
+
@functools.wraps(cmd)
|
|
395
|
+
def decorator(*args, **kwargs):
|
|
396
|
+
with CliHookRegistry.get().cli_download():
|
|
397
|
+
return cmd(*args, **kwargs)
|
|
398
|
+
return decorator
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
def cli_report(cmd):
|
|
402
|
+
@functools.wraps(cmd)
|
|
403
|
+
def decorator(*args, **kwargs):
|
|
404
|
+
with CliHookRegistry.get().cli_report():
|
|
405
|
+
return cmd(*args, **kwargs)
|
|
406
|
+
return decorator
|
jolt/influence.py
CHANGED
|
@@ -3,6 +3,7 @@ import hashlib
|
|
|
3
3
|
import os
|
|
4
4
|
from pathlib import Path, PurePath
|
|
5
5
|
|
|
6
|
+
from jolt import config as jolt_config
|
|
6
7
|
from jolt import inspection
|
|
7
8
|
from jolt import utils
|
|
8
9
|
from jolt import filesystem as fs
|
|
@@ -61,7 +62,7 @@ class TaskAttributeInfluence(HashInfluenceProvider):
|
|
|
61
62
|
value = getattr(task, tools.Tools(task).expand(self._attrib), "N/A")
|
|
62
63
|
try:
|
|
63
64
|
value = value.__get__(task)
|
|
64
|
-
if type(value)
|
|
65
|
+
if type(value) is list and self._sort:
|
|
65
66
|
value.sort()
|
|
66
67
|
except AttributeError:
|
|
67
68
|
pass
|
|
@@ -146,12 +147,16 @@ class TaskSourceInfluence(HashInfluenceProvider):
|
|
|
146
147
|
pass
|
|
147
148
|
|
|
148
149
|
# Collect all functions from the class hierarchy
|
|
149
|
-
if type(obj)
|
|
150
|
+
if type(obj) is type:
|
|
150
151
|
funcs = [utils.getattr_safe(mro, funcname, TaskSourceInfluence._default_func)
|
|
151
152
|
for mro in obj.mro()]
|
|
152
|
-
|
|
153
|
+
elif callable(obj) and hasattr(obj, "__self__"):
|
|
153
154
|
funcs = [utils.getattr_safe(mro, funcname, TaskSourceInfluence._default_func)
|
|
154
155
|
for mro in obj.__class__.mro()]
|
|
156
|
+
elif callable(obj):
|
|
157
|
+
funcs = [obj]
|
|
158
|
+
else:
|
|
159
|
+
funcs = []
|
|
155
160
|
|
|
156
161
|
# Calculate sha1 sum for all functions
|
|
157
162
|
shasum = hashlib.sha1()
|
|
@@ -197,6 +202,71 @@ def source(name, obj=None):
|
|
|
197
202
|
return _decorate
|
|
198
203
|
|
|
199
204
|
|
|
205
|
+
class ConfigInfluence(HashInfluenceProvider):
|
|
206
|
+
name = "Config"
|
|
207
|
+
|
|
208
|
+
def __init__(self, section, key):
|
|
209
|
+
self.section = section
|
|
210
|
+
self.key = key
|
|
211
|
+
|
|
212
|
+
def get_influence(self, task):
|
|
213
|
+
value = jolt_config.get(self.section, self.key)
|
|
214
|
+
if value is None:
|
|
215
|
+
value = "<unset>"
|
|
216
|
+
return "{}.{}: {}".format(self.section, self.key, value)
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
def config(section, key):
|
|
220
|
+
""" Add configuration value as hash influence.
|
|
221
|
+
|
|
222
|
+
Note that the configuration value is read at the time
|
|
223
|
+
when the task is prepared, not when it is executed.
|
|
224
|
+
This means that if the configuration value changes after
|
|
225
|
+
influence has been calculated, the task will not be re-executed.
|
|
226
|
+
This is true also in distributed mode, where the task
|
|
227
|
+
is prepared locally and executed remotely on a worker
|
|
228
|
+
where the configuration value may be different.
|
|
229
|
+
|
|
230
|
+
Args:
|
|
231
|
+
section (str): Name of the configuration section.
|
|
232
|
+
key (str): Name of the configuration key.
|
|
233
|
+
|
|
234
|
+
Example:
|
|
235
|
+
.. code-block:: python
|
|
236
|
+
|
|
237
|
+
from jolt import influence
|
|
238
|
+
|
|
239
|
+
@influence.config("jolt", "task_timeout")
|
|
240
|
+
class Example(Task):
|
|
241
|
+
|
|
242
|
+
"""
|
|
243
|
+
def _decorate(cls):
|
|
244
|
+
_old_influence = cls._influence
|
|
245
|
+
|
|
246
|
+
def _influence(self, *args, **kwargs):
|
|
247
|
+
influence = _old_influence(self, *args, **kwargs)
|
|
248
|
+
influence.append(ConfigInfluence(section, key))
|
|
249
|
+
return influence
|
|
250
|
+
|
|
251
|
+
cls._influence = _influence
|
|
252
|
+
return cls
|
|
253
|
+
|
|
254
|
+
return _decorate
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
def global_config(section, key):
|
|
258
|
+
""" Register a configuration influence globally.
|
|
259
|
+
|
|
260
|
+
See :py:func:`config` for more information.
|
|
261
|
+
|
|
262
|
+
Args:
|
|
263
|
+
section (str): Name of the configuration section.
|
|
264
|
+
key (str): Name of the configuration key.
|
|
265
|
+
"""
|
|
266
|
+
|
|
267
|
+
HashInfluenceRegistry.get().register(ConfigInfluence(section, key))
|
|
268
|
+
|
|
269
|
+
|
|
200
270
|
class TaskClassSourceInfluence(HashInfluenceProvider):
|
|
201
271
|
name = "Source"
|
|
202
272
|
|
|
@@ -218,6 +288,18 @@ class TaskClassSourceInfluence(HashInfluenceProvider):
|
|
|
218
288
|
return result
|
|
219
289
|
|
|
220
290
|
|
|
291
|
+
class CallbackInfluence(HashInfluenceProvider):
|
|
292
|
+
def __init__(self, desc, fn, *args, **kwargs):
|
|
293
|
+
self.name = "Callback"
|
|
294
|
+
self.desc = desc
|
|
295
|
+
self.fn = fn
|
|
296
|
+
self.args = args
|
|
297
|
+
self.kwargs = kwargs
|
|
298
|
+
|
|
299
|
+
def get_influence(self, task):
|
|
300
|
+
return self.desc + ": " + str(self.fn(*self.args, **self.kwargs))
|
|
301
|
+
|
|
302
|
+
|
|
221
303
|
class TaskRequirementInfluence(HashInfluenceProvider):
|
|
222
304
|
name = "Requirement"
|
|
223
305
|
|
|
@@ -229,6 +311,13 @@ class TaskRequirementInfluence(HashInfluenceProvider):
|
|
|
229
311
|
return "{}: {}".format(self._identity, self._name)
|
|
230
312
|
|
|
231
313
|
|
|
314
|
+
class CacheLocationInfluence(HashInfluenceProvider):
|
|
315
|
+
name = "Cache"
|
|
316
|
+
|
|
317
|
+
def get_influence(self, task):
|
|
318
|
+
return jolt_config.get_cachedir()
|
|
319
|
+
|
|
320
|
+
|
|
232
321
|
@HashInfluenceRegistry.Register
|
|
233
322
|
class TaskNameInfluence(HashInfluenceProvider):
|
|
234
323
|
name = "Name"
|
|
@@ -586,15 +675,49 @@ def whitelist(pathname):
|
|
|
586
675
|
class StringInfluence(HashInfluenceProvider):
|
|
587
676
|
name = "String"
|
|
588
677
|
|
|
589
|
-
def __init__(self, value):
|
|
678
|
+
def __init__(self, value, selfdeploy=False):
|
|
590
679
|
self.value = value
|
|
680
|
+
self.selfdeploy = selfdeploy
|
|
591
681
|
|
|
592
682
|
def get_influence(self, task):
|
|
683
|
+
if not self.selfdeploy and task.name in ["jolt"]:
|
|
684
|
+
return "jolt"
|
|
593
685
|
return self.value
|
|
594
686
|
|
|
595
687
|
|
|
596
|
-
def
|
|
597
|
-
|
|
688
|
+
def string(string, selfdeploy=False):
|
|
689
|
+
""" Add string hash influence.
|
|
690
|
+
|
|
691
|
+
Args:
|
|
692
|
+
string (str): A string that will influence the hash of the task.
|
|
693
|
+
|
|
694
|
+
Example:
|
|
695
|
+
|
|
696
|
+
.. code-block:: python
|
|
697
|
+
|
|
698
|
+
from jolt import influence
|
|
699
|
+
|
|
700
|
+
@influence.string("example")
|
|
701
|
+
class Example(Task):
|
|
702
|
+
|
|
703
|
+
"""
|
|
704
|
+
|
|
705
|
+
def _decorate(cls):
|
|
706
|
+
_old_influence = cls._influence
|
|
707
|
+
|
|
708
|
+
def _influence(self, *args, **kwargs):
|
|
709
|
+
influence = _old_influence(self, *args, **kwargs)
|
|
710
|
+
influence.append(StringInfluence(string, selfdeploy=selfdeploy))
|
|
711
|
+
return influence
|
|
712
|
+
|
|
713
|
+
cls._influence = _influence
|
|
714
|
+
return cls
|
|
715
|
+
|
|
716
|
+
return _decorate
|
|
717
|
+
|
|
718
|
+
|
|
719
|
+
def global_string(string, selfdeploy=False):
|
|
720
|
+
HashInfluenceRegistry.get().register(StringInfluence(string, selfdeploy=selfdeploy))
|
|
598
721
|
|
|
599
722
|
|
|
600
723
|
class VersionInfluence(HashInfluenceProvider):
|