scriptengine 0.14.4__py3-none-any.whl → 1.0.0rc2__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.
- scriptengine/cli/se.py +7 -11
- scriptengine/context.py +115 -87
- scriptengine/engines/simple_script_engine.py +9 -6
- scriptengine/exceptions.py +1 -1
- scriptengine/helpers/terminal_colors.py +1 -1
- scriptengine/jinja.py +13 -6
- scriptengine/jobs.py +15 -15
- scriptengine/tasks/base/command.py +15 -7
- scriptengine/tasks/base/context.py +5 -4
- scriptengine/tasks/base/envvars.py +3 -3
- scriptengine/tasks/base/find.py +2 -2
- scriptengine/tasks/base/include.py +4 -5
- scriptengine/tasks/base/template.py +11 -4
- scriptengine/tasks/core/loader.py +18 -14
- scriptengine/tasks/core/task.py +56 -62
- scriptengine/yaml/parser.py +1 -1
- {scriptengine-0.14.4.dist-info → scriptengine-1.0.0rc2.dist-info}/METADATA +11 -3
- {scriptengine-0.14.4.dist-info → scriptengine-1.0.0rc2.dist-info}/RECORD +22 -22
- {scriptengine-0.14.4.dist-info → scriptengine-1.0.0rc2.dist-info}/WHEEL +1 -1
- {scriptengine-0.14.4.dist-info → scriptengine-1.0.0rc2.dist-info}/entry_points.txt +0 -18
- {scriptengine-0.14.4.dist-info → scriptengine-1.0.0rc2.dist-info}/LICENSE +0 -0
- {scriptengine-0.14.4.dist-info → scriptengine-1.0.0rc2.dist-info}/top_level.txt +0 -0
scriptengine/cli/se.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""ScriptEngine command line interface (cli).
|
|
2
2
|
|
|
3
3
|
The se command provides a command line interface to ScriptEngine, allowing for
|
|
4
|
-
the creation of scripts from YAML files and
|
|
4
|
+
the creation of scripts from YAML files and running the scripts via the
|
|
5
5
|
SimpleScriptEngine.
|
|
6
6
|
"""
|
|
7
7
|
|
|
@@ -26,21 +26,19 @@ along with ScriptEngine. If not, see <https://www.gnu.org/licenses/>.
|
|
|
26
26
|
__license__ = "GPLv3+"
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
import os
|
|
30
29
|
import argparse
|
|
30
|
+
import importlib.metadata
|
|
31
31
|
import logging
|
|
32
|
-
import
|
|
32
|
+
import os
|
|
33
33
|
|
|
34
34
|
import scriptengine.helpers.terminal_colors
|
|
35
35
|
import scriptengine.logging
|
|
36
|
-
|
|
37
|
-
from scriptengine.tasks.core.loader import load as load_tasks
|
|
38
|
-
from scriptengine.yaml.parser import parse_file as parse_yaml_file
|
|
39
|
-
|
|
40
36
|
from scriptengine.engines import SimpleScriptEngine
|
|
41
37
|
from scriptengine.exceptions import ScriptEngineParseError, ScriptEngineParseFileError
|
|
38
|
+
from scriptengine.tasks.core.loader import load as load_tasks
|
|
39
|
+
from scriptengine.yaml.parser import parse_file as parse_yaml_file
|
|
42
40
|
|
|
43
|
-
__version__ =
|
|
41
|
+
__version__ = importlib.metadata.version("scriptengine")
|
|
44
42
|
|
|
45
43
|
|
|
46
44
|
def parse_cmd_line_args():
|
|
@@ -138,9 +136,7 @@ def main():
|
|
|
138
136
|
logger.critical("Could not parse all script files")
|
|
139
137
|
return os.EX_DATAERR
|
|
140
138
|
|
|
141
|
-
#
|
|
142
|
-
# order of entries before Python 3.7! We'll accept this in favour of the
|
|
143
|
-
# easier implementation.
|
|
139
|
+
# Collect paths (and remove duplicates)
|
|
144
140
|
script_path = tuple(
|
|
145
141
|
dict.fromkeys((os.path.dirname(file) for file in parsed_args.files))
|
|
146
142
|
)
|
scriptengine/context.py
CHANGED
|
@@ -1,96 +1,124 @@
|
|
|
1
|
-
import
|
|
2
|
-
from
|
|
1
|
+
from collections import UserDict
|
|
2
|
+
from collections.abc import Mapping
|
|
3
|
+
from typing import Any
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
import yaml
|
|
5
6
|
from deepmerge import always_merger
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
KEY_SEP = "."
|
|
8
9
|
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
"""For versions other than 3.6, this is just copy.deepcopy.
|
|
12
|
-
For 3.6, we have to remove ["se"]["instance"] before deepcopying and restore
|
|
13
|
-
afterwards, because this constitutes some recursive reference that 3.6 has a
|
|
14
|
-
problem with.
|
|
11
|
+
class Context(UserDict):
|
|
15
12
|
"""
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
13
|
+
The ScriptEngine Context provides context information for Tasks
|
|
14
|
+
|
|
15
|
+
https://scriptengine.readthedocs.io/en/latest/concepts.html#task-context
|
|
16
|
+
The Context is a special dict that allows
|
|
17
|
+
* dotted keys, i.e. c["foo.bar"] is equivalent to c["foo"]["bar"]
|
|
18
|
+
* deep merges of other Mappings (via deepmerge.always_merger)
|
|
19
|
+
* save and load the data to/from a file-like object
|
|
20
|
+
|
|
21
|
+
Methods
|
|
22
|
+
-------
|
|
23
|
+
merge(other)
|
|
24
|
+
Deep merges other into the context
|
|
25
|
+
|
|
26
|
+
reset(keep=None)
|
|
27
|
+
Deletes all data from the context, except for the keys listed in 'keep'
|
|
28
|
+
|
|
29
|
+
save(stream)
|
|
30
|
+
...
|
|
31
|
+
|
|
32
|
+
load(stream)
|
|
33
|
+
...
|
|
37
34
|
"""
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
self.merge = self.delta = None
|
|
68
|
-
elif second is None:
|
|
69
|
-
if not isinstance(base, dict):
|
|
70
|
-
raise TypeError(
|
|
71
|
-
"First argument of ContextUpdate() must be None or a dict"
|
|
72
|
-
)
|
|
73
|
-
self.merge = base
|
|
74
|
-
self.delta = None
|
|
35
|
+
|
|
36
|
+
def __getitem__(self, key: Any) -> Any:
|
|
37
|
+
"""Return x[key] where key is possibly a dotted key"""
|
|
38
|
+
def iter_getitem(data, subkey):
|
|
39
|
+
try:
|
|
40
|
+
return data[subkey]
|
|
41
|
+
except TypeError: # dotted key with too many components
|
|
42
|
+
raise KeyError(subkey)
|
|
43
|
+
except KeyError:
|
|
44
|
+
pass
|
|
45
|
+
try:
|
|
46
|
+
first, _, remain = subkey.partition(KEY_SEP)
|
|
47
|
+
except AttributeError:
|
|
48
|
+
raise KeyError(subkey)
|
|
49
|
+
return iter_getitem(data[first], remain)
|
|
50
|
+
|
|
51
|
+
try:
|
|
52
|
+
return iter_getitem(self.data, key)
|
|
53
|
+
except KeyError as e:
|
|
54
|
+
raise KeyError(
|
|
55
|
+
f"{key} (subkey {e} not found)" if str(key) != str(e) else key
|
|
56
|
+
) from None
|
|
57
|
+
|
|
58
|
+
def __setitem__(self, key: Any, item: Any) -> None:
|
|
59
|
+
"""Set x[key]=item where key is possibly a dotted key"""
|
|
60
|
+
try:
|
|
61
|
+
keys = key.split(KEY_SEP)
|
|
62
|
+
except AttributeError:
|
|
63
|
+
self.data[key] = item
|
|
75
64
|
else:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
65
|
+
d = self.data
|
|
66
|
+
for k in keys[:-1]:
|
|
67
|
+
# allow overwriting of non-mapping keys
|
|
68
|
+
if k not in d or not isinstance(d[k], Mapping):
|
|
69
|
+
d[k] = {}
|
|
70
|
+
d = d[k]
|
|
71
|
+
# Make sure that nested dotted keys are resolved!
|
|
72
|
+
d[keys[-1]] = Context(item).data if isinstance(item, Mapping) else item
|
|
73
|
+
|
|
74
|
+
def __contains__(self, key: object) -> bool:
|
|
75
|
+
def iter_contains(data, subkey):
|
|
76
|
+
if subkey in data:
|
|
77
|
+
return True
|
|
78
|
+
try:
|
|
79
|
+
first, _, remain = subkey.partition(KEY_SEP)
|
|
80
|
+
except AttributeError:
|
|
81
|
+
return False
|
|
82
|
+
if first in data:
|
|
83
|
+
return iter_contains(data[first], remain)
|
|
84
|
+
return False
|
|
85
|
+
|
|
86
|
+
return iter_contains(self.data, key)
|
|
87
|
+
|
|
88
|
+
def __str__(self) -> str:
|
|
89
|
+
return f"Context({self.data})"
|
|
90
|
+
|
|
91
|
+
def __add__(self, other):
|
|
92
|
+
if isinstance(other, Mapping):
|
|
93
|
+
self.merge(other)
|
|
94
|
+
return self
|
|
95
|
+
return NotImplemented
|
|
96
|
+
|
|
97
|
+
def merge(self, other):
|
|
98
|
+
if isinstance(other, Context):
|
|
99
|
+
always_merger.merge(self.data, other.data)
|
|
100
|
+
elif isinstance(other, Mapping):
|
|
101
|
+
always_merger.merge(self.data, other)
|
|
95
102
|
else:
|
|
96
|
-
|
|
103
|
+
raise TypeError(f"can not merge Context and {type(other).__name__}")
|
|
104
|
+
|
|
105
|
+
def reset(self, keep=None):
|
|
106
|
+
save_copy = Context()
|
|
107
|
+
for k in keep or []:
|
|
108
|
+
if k in self:
|
|
109
|
+
save_copy[k] = self[k]
|
|
110
|
+
self.data.clear()
|
|
111
|
+
for k in save_copy:
|
|
112
|
+
self[k] = save_copy[k]
|
|
113
|
+
|
|
114
|
+
def load(self, stream):
|
|
115
|
+
self.data = yaml.safe_load(stream)
|
|
116
|
+
|
|
117
|
+
def save(self, stream):
|
|
118
|
+
yaml.dump(self.data, stream, sort_keys=False)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
# from dotty_dict import Dotty
|
|
122
|
+
# class Context(Dotty):
|
|
123
|
+
# def __init__(self, dictionary=None):
|
|
124
|
+
# super().__init__(dictionary or {}, no_list=True)
|
|
@@ -5,11 +5,12 @@ on the local machine, without consideration of job contexts. The
|
|
|
5
5
|
SimpleScriptEngine relies on the Job class to run the actual tasks/jobs.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
+
import copy
|
|
8
9
|
import logging
|
|
9
10
|
import sys
|
|
10
11
|
from pprint import pprint
|
|
11
12
|
|
|
12
|
-
from scriptengine.context import Context
|
|
13
|
+
from scriptengine.context import Context
|
|
13
14
|
from scriptengine.exceptions import (
|
|
14
15
|
ScriptEngineJobError,
|
|
15
16
|
ScriptEngineStopException,
|
|
@@ -64,12 +65,14 @@ class SimpleScriptEngine:
|
|
|
64
65
|
sys.exit()
|
|
65
66
|
|
|
66
67
|
def run(self, script, context):
|
|
67
|
-
local_context = Context(
|
|
68
|
+
local_context = Context(context)
|
|
69
|
+
context_update = Context()
|
|
68
70
|
for todo in script if isinstance(script, list) else [script]:
|
|
69
|
-
|
|
70
|
-
if
|
|
71
|
-
local_context +=
|
|
72
|
-
|
|
71
|
+
c = self._guarded_run(todo, local_context)
|
|
72
|
+
if c:
|
|
73
|
+
local_context += c
|
|
74
|
+
context_update += copy.deepcopy(c)
|
|
75
|
+
return context_update or None
|
|
73
76
|
|
|
74
77
|
def _log(self, level, msg):
|
|
75
78
|
self.logger.log(level, msg)
|
scriptengine/exceptions.py
CHANGED
|
@@ -15,7 +15,7 @@ class ScriptEngineParseError(ScriptEngineError):
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
class ScriptEngineParseFileError(ScriptEngineParseError):
|
|
18
|
-
"""An file error while
|
|
18
|
+
"""An file error while accessing an SE script"""
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
class ScriptEngineParseJinjaError(ScriptEngineParseError):
|
scriptengine/jinja.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""ScriptEngine helpers: Jinja2 rendering"""
|
|
2
2
|
|
|
3
3
|
import datetime
|
|
4
|
-
import distutils.util
|
|
5
4
|
import os
|
|
6
5
|
|
|
7
6
|
import jinja2
|
|
@@ -57,6 +56,14 @@ for name, function in filters().items():
|
|
|
57
56
|
_param_env.filters[name] = function
|
|
58
57
|
|
|
59
58
|
|
|
59
|
+
def _strtobool(value):
|
|
60
|
+
if value in ("y", "yes", "t", "true", "on", "1"):
|
|
61
|
+
return True
|
|
62
|
+
elif value in ("n", "no", "f", "false", "off", "0"):
|
|
63
|
+
return False
|
|
64
|
+
raise ValueError(f"Cannot convert '{value}' to a boolean value")
|
|
65
|
+
|
|
66
|
+
|
|
60
67
|
def render(arg, context, recursive=True, boolean=False):
|
|
61
68
|
"""Renders a string with Jinja2.
|
|
62
69
|
|
|
@@ -87,11 +94,11 @@ def render(arg, context, recursive=True, boolean=False):
|
|
|
87
94
|
try:
|
|
88
95
|
# Render string in parameter environment using context
|
|
89
96
|
return _param_env.from_string(string_arg).render(context)
|
|
90
|
-
except jinja2.
|
|
97
|
+
except jinja2.TemplateError as e:
|
|
91
98
|
raise ScriptEngineParseJinjaError(
|
|
92
|
-
"
|
|
93
|
-
f
|
|
94
|
-
f
|
|
99
|
+
f"Jinja2 {type(e).__name__} while parsing '{string_arg}'"
|
|
100
|
+
f"{' (in boolean context): ' if boolean else ': '}"
|
|
101
|
+
f"{e}"
|
|
95
102
|
)
|
|
96
103
|
|
|
97
104
|
if isinstance(arg, str):
|
|
@@ -103,7 +110,7 @@ def render(arg, context, recursive=True, boolean=False):
|
|
|
103
110
|
next_rendered_string = render_with_context(rendered_string)
|
|
104
111
|
if boolean:
|
|
105
112
|
expr = f"{{% if {rendered_string} %}}1{{% else %}}0{{% endif %}}"
|
|
106
|
-
return
|
|
113
|
+
return _strtobool(render_with_context(expr))
|
|
107
114
|
return rendered_string
|
|
108
115
|
else:
|
|
109
116
|
return arg
|
scriptengine/jobs.py
CHANGED
|
@@ -6,10 +6,11 @@ be given to a ScriptEngine, for execution.
|
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
8
|
import ast
|
|
9
|
+
import copy
|
|
9
10
|
import logging
|
|
10
11
|
import uuid
|
|
11
12
|
|
|
12
|
-
from scriptengine.context import Context
|
|
13
|
+
from scriptengine.context import Context
|
|
13
14
|
from scriptengine.exceptions import (
|
|
14
15
|
ScriptEngineJobParseError,
|
|
15
16
|
ScriptEngineParseJinjaError,
|
|
@@ -74,29 +75,26 @@ class Job:
|
|
|
74
75
|
def when(self, context):
|
|
75
76
|
try:
|
|
76
77
|
return self._when is None or j2render(self._when, context, boolean=True)
|
|
77
|
-
except ScriptEngineParseJinjaError:
|
|
78
|
+
except ScriptEngineParseJinjaError as e:
|
|
78
79
|
self.log_error(
|
|
79
|
-
"
|
|
80
|
-
f'"{self._when}" with context "{context}"'
|
|
80
|
+
f"Jinja2 error in *when* clause '{self._when}' (full error: {e})"
|
|
81
81
|
)
|
|
82
82
|
raise ScriptEngineJobParseError
|
|
83
83
|
|
|
84
84
|
def loop_spec(self, context):
|
|
85
85
|
try:
|
|
86
86
|
iter = j2render(self._loop, context)
|
|
87
|
-
except ScriptEngineParseJinjaError:
|
|
87
|
+
except ScriptEngineParseJinjaError as e:
|
|
88
88
|
self.log_error(
|
|
89
|
-
"
|
|
90
|
-
f'"{self._loop}" with context "{context}"'
|
|
89
|
+
f"Jinja2 error in *loop* spec '{self._loop}' (full error: {e})"
|
|
91
90
|
)
|
|
92
91
|
raise ScriptEngineJobParseError
|
|
93
92
|
if isinstance(iter, str):
|
|
94
93
|
try:
|
|
95
94
|
iter = ast.literal_eval(iter or "None")
|
|
96
|
-
except (SyntaxError, ValueError):
|
|
95
|
+
except (SyntaxError, ValueError) as e:
|
|
97
96
|
self.log_error(
|
|
98
|
-
"
|
|
99
|
-
f'"{iter}" with context "{context}"'
|
|
97
|
+
f"AST evaluation error in *loop* spec '{iter}' (full error: {e})"
|
|
100
98
|
)
|
|
101
99
|
raise ScriptEngineJobParseError
|
|
102
100
|
if isinstance(iter, dict):
|
|
@@ -138,7 +136,8 @@ class Job:
|
|
|
138
136
|
|
|
139
137
|
def run(self, context):
|
|
140
138
|
if self.when(context):
|
|
141
|
-
local_context = Context(
|
|
139
|
+
local_context = Context(copy.deepcopy(context))
|
|
140
|
+
context_update = Context()
|
|
142
141
|
for items in self.loop(local_context):
|
|
143
142
|
if set(items) & set(local_context):
|
|
144
143
|
self.log_warning(
|
|
@@ -146,10 +145,11 @@ class Job:
|
|
|
146
145
|
f"context: {set(items) & set(local_context)}"
|
|
147
146
|
)
|
|
148
147
|
for t in self.todo:
|
|
149
|
-
|
|
150
|
-
if
|
|
151
|
-
local_context +=
|
|
152
|
-
|
|
148
|
+
c = t.run(Context({**local_context, **items}))
|
|
149
|
+
if c:
|
|
150
|
+
local_context += c
|
|
151
|
+
context_update += c
|
|
152
|
+
return context_update or None
|
|
153
153
|
|
|
154
154
|
def _log(self, level, msg):
|
|
155
155
|
logging.getLogger("se.job").log(level, msg, extra={"id": self.shortid})
|
|
@@ -11,7 +11,7 @@ import subprocess
|
|
|
11
11
|
import threading
|
|
12
12
|
from contextlib import contextmanager
|
|
13
13
|
|
|
14
|
-
from scriptengine.context import
|
|
14
|
+
from scriptengine.context import Context
|
|
15
15
|
from scriptengine.exceptions import (
|
|
16
16
|
ScriptEngineTaskArgumentInvalidError,
|
|
17
17
|
ScriptEngineTaskRunError,
|
|
@@ -111,7 +111,7 @@ class Command(Task):
|
|
|
111
111
|
f'{stderr_mode if stderr_mode in (True, False) else "context"}'
|
|
112
112
|
)
|
|
113
113
|
with log_pipe(stdout_mode) as stdout, log_pipe(stderr_mode) as stderr:
|
|
114
|
-
context_update =
|
|
114
|
+
context_update = Context()
|
|
115
115
|
try:
|
|
116
116
|
cmd_proc = subprocess.run(
|
|
117
117
|
map(str, (command, *args)),
|
|
@@ -124,12 +124,20 @@ class Command(Task):
|
|
|
124
124
|
except subprocess.CalledProcessError as e:
|
|
125
125
|
if ignore_error:
|
|
126
126
|
self.log_warning(f"Command returned error code {e.returncode}")
|
|
127
|
+
stdout = e.stdout
|
|
128
|
+
stderr = e.stderr
|
|
127
129
|
else:
|
|
128
130
|
self.log_error(f"Command returned error code {e.returncode}")
|
|
129
131
|
raise ScriptEngineTaskRunError
|
|
130
132
|
else:
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
stdout = cmd_proc.stdout
|
|
134
|
+
stderr = cmd_proc.stderr
|
|
135
|
+
|
|
136
|
+
if isinstance(stdout_mode, str):
|
|
137
|
+
self.log_debug(f"Store stdout in context under {stdout_mode}")
|
|
138
|
+
context_update[stdout_mode] = stdout.split("\n")
|
|
139
|
+
if isinstance(stderr_mode, str):
|
|
140
|
+
self.log_debug(f"Store stderr in context under {stderr_mode}")
|
|
141
|
+
context_update[stderr_mode] = stderr.split("\n")
|
|
142
|
+
|
|
143
|
+
return context_update or None
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import yaml
|
|
4
4
|
|
|
5
|
-
from scriptengine.context import
|
|
5
|
+
from scriptengine.context import (
|
|
6
|
+
Context as SEContext,
|
|
7
|
+
) # avoid name clashes between se.context.Context and se.tasks.base.Context
|
|
6
8
|
from scriptengine.exceptions import ScriptEngineTaskError, ScriptEngineTaskRunError
|
|
7
9
|
from scriptengine.tasks.core import Task, timed_runner
|
|
8
10
|
|
|
@@ -18,7 +20,7 @@ class Context(Task):
|
|
|
18
20
|
|
|
19
21
|
@timed_runner
|
|
20
22
|
def run(self, context):
|
|
21
|
-
context_update =
|
|
23
|
+
context_update = SEContext(
|
|
22
24
|
{n: self.getarg(n, context) for n in vars(self) if not n.startswith("_")}
|
|
23
25
|
)
|
|
24
26
|
self.log_info(f"Context update: {context_update}")
|
|
@@ -48,7 +50,6 @@ class ContextFrom(Task):
|
|
|
48
50
|
|
|
49
51
|
@timed_runner
|
|
50
52
|
def run(self, context):
|
|
51
|
-
|
|
52
53
|
dict_arg = self.getarg("dict", context, default=False)
|
|
53
54
|
file_arg = self.getarg("file", context, default=False)
|
|
54
55
|
|
|
@@ -93,4 +94,4 @@ class ContextFrom(Task):
|
|
|
93
94
|
self.log_error("Missing argument: either 'dict' or 'file' is needed")
|
|
94
95
|
raise ScriptEngineTaskError
|
|
95
96
|
|
|
96
|
-
return
|
|
97
|
+
return SEContext(context_update_d)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import os
|
|
4
4
|
|
|
5
|
-
from scriptengine.context import
|
|
5
|
+
from scriptengine.context import Context
|
|
6
6
|
from scriptengine.tasks.core import Task, timed_runner
|
|
7
7
|
|
|
8
8
|
|
|
@@ -33,13 +33,13 @@ class Getenv(Task):
|
|
|
33
33
|
valid[n] = os.environ[v]
|
|
34
34
|
except KeyError:
|
|
35
35
|
self.log_warning(f"Environment variable {v} does not exist")
|
|
36
|
-
return
|
|
36
|
+
return Context(valid)
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
class Setenv(Task):
|
|
40
40
|
"""Setenv task, sets environment variables from context.
|
|
41
41
|
Setenv.run() takes the list of argument name, value pairs, and sets the
|
|
42
|
-
|
|
42
|
+
environment variables given by the argument names to the values given by the
|
|
43
43
|
argument values. For example,
|
|
44
44
|
base.setenv:
|
|
45
45
|
foo: one
|
scriptengine/tasks/base/find.py
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import fnmatch
|
|
4
4
|
import os
|
|
5
5
|
|
|
6
|
-
from scriptengine.context import
|
|
6
|
+
from scriptengine.context import Context
|
|
7
7
|
from scriptengine.exceptions import ScriptEngineTaskArgumentInvalidError
|
|
8
8
|
from scriptengine.tasks.core import Task, timed_runner
|
|
9
9
|
|
|
@@ -63,4 +63,4 @@ class Find(Task):
|
|
|
63
63
|
result_key = self.getarg("set", context, default="result")
|
|
64
64
|
self.log_debug(f'Store result under context key "{result_key}"')
|
|
65
65
|
|
|
66
|
-
return
|
|
66
|
+
return Context({result_key: result})
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
ScriptEngine script and lets the active ScriptEngine instance execute it.
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
|
+
import copy
|
|
7
8
|
from pathlib import Path
|
|
8
9
|
|
|
9
|
-
from scriptengine.context import Context
|
|
10
|
+
from scriptengine.context import Context
|
|
10
11
|
from scriptengine.exceptions import ScriptEngineTaskRunError
|
|
11
12
|
from scriptengine.tasks.core import Task, timed_runner
|
|
12
13
|
from scriptengine.yaml.parser import parse_file
|
|
@@ -67,10 +68,8 @@ class Include(Task):
|
|
|
67
68
|
script = parse_file(inc_file)
|
|
68
69
|
|
|
69
70
|
self.log_debug(f"Execute include script: {inc_file}")
|
|
70
|
-
local_context = Context(
|
|
71
|
+
local_context = Context(copy.deepcopy(context))
|
|
71
72
|
context_update = local_context["se"]["instance"].run(script, local_context)
|
|
72
|
-
if context_update:
|
|
73
|
-
local_context += context_update
|
|
74
73
|
self.log_debug(f"Finished executing include script: {inc_file}")
|
|
75
74
|
|
|
76
|
-
return
|
|
75
|
+
return context_update or None
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"""Template task for ScriptEngine."""
|
|
2
2
|
|
|
3
|
-
from pathlib import Path
|
|
4
3
|
import os
|
|
5
4
|
import stat
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
6
7
|
import jinja2
|
|
7
8
|
|
|
8
|
-
from scriptengine.
|
|
9
|
-
from scriptengine.jinja import render as j2render
|
|
9
|
+
from scriptengine.exceptions import ScriptEngineTaskRunError
|
|
10
10
|
from scriptengine.jinja import filters as j2filters
|
|
11
|
+
from scriptengine.jinja import render as j2render
|
|
12
|
+
from scriptengine.tasks.core import Task, timed_runner
|
|
11
13
|
|
|
12
14
|
|
|
13
15
|
class Template(Task):
|
|
@@ -54,7 +56,12 @@ class Template(Task):
|
|
|
54
56
|
for name, function in j2filters().items():
|
|
55
57
|
j2env.filters[name] = function
|
|
56
58
|
|
|
57
|
-
|
|
59
|
+
try:
|
|
60
|
+
output = j2render(j2env.get_template(src).render(context), context)
|
|
61
|
+
except jinja2.TemplateError as e:
|
|
62
|
+
self.log_error(f"Jinja2 error {type(e).__name__}: {e}")
|
|
63
|
+
raise ScriptEngineTaskRunError
|
|
64
|
+
|
|
58
65
|
with dst.open(mode="w") as f:
|
|
59
66
|
f.write(output + "\n")
|
|
60
67
|
|
|
@@ -1,32 +1,36 @@
|
|
|
1
|
-
import pkg_resources
|
|
2
|
-
import logging
|
|
3
1
|
import functools
|
|
2
|
+
import logging
|
|
3
|
+
|
|
4
|
+
try:
|
|
5
|
+
from importlib.metadata import entry_points
|
|
6
|
+
except ModuleNotFoundError: # Python prior to 3.8
|
|
7
|
+
from importlib_metadata import entry_points
|
|
4
8
|
|
|
5
9
|
from scriptengine.exceptions import ScriptEngineTaskLoaderError
|
|
6
10
|
|
|
7
11
|
|
|
8
|
-
# The load function
|
|
12
|
+
# The load function goes through entry points, searching for ScriptEngine
|
|
9
13
|
# tasks. Since the function can be called quite frequently and modules are
|
|
10
14
|
# *usually* not loaded while SE is run, the result is cached.
|
|
11
15
|
# Note that this means that dynamic module is *not supported* by the loading
|
|
12
16
|
# mechanism!
|
|
13
17
|
@functools.lru_cache(maxsize=None)
|
|
14
18
|
def load():
|
|
15
|
-
|
|
16
|
-
entry_point = 'scriptengine.tasks'
|
|
17
|
-
|
|
18
19
|
loaded_tasks = dict()
|
|
19
|
-
|
|
20
|
+
try:
|
|
21
|
+
eps = entry_points(group="scriptengine.tasks")
|
|
22
|
+
except TypeError: # importlib.metadata prior to Python 3.10
|
|
23
|
+
eps = set(entry_points().get("scriptengine.tasks", []))
|
|
24
|
+
for ep in eps:
|
|
20
25
|
if ep.name not in loaded_tasks:
|
|
21
26
|
loaded_tasks[ep.name] = ep.load()
|
|
22
27
|
else:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
f'
|
|
29
|
-
f'"{ep.module_name}" and "{clash}"'
|
|
28
|
+
existing_ep = next(cep for cep in eps if cep.name == ep.name)
|
|
29
|
+
existing_mod = existing_ep.value.partition(":")[0]
|
|
30
|
+
clashing_mod = ep.value.partition(":")[0]
|
|
31
|
+
logging.getLogger("se.task.loader").error(
|
|
32
|
+
f'Same task name "{ep.name}" defined in modules '
|
|
33
|
+
f'"{existing_mod}" and "{clashing_mod}"'
|
|
30
34
|
)
|
|
31
35
|
raise ScriptEngineTaskLoaderError
|
|
32
36
|
|
scriptengine/tasks/core/task.py
CHANGED
|
@@ -5,26 +5,27 @@ Provides the base class for all tasks.
|
|
|
5
5
|
|
|
6
6
|
import logging
|
|
7
7
|
import uuid
|
|
8
|
+
|
|
8
9
|
import yaml
|
|
9
10
|
|
|
10
11
|
import scriptengine.jinja
|
|
11
|
-
from scriptengine.yaml.noparse_strings import (
|
|
12
|
-
NoParseJinjaString,
|
|
13
|
-
NoParseYamlString,
|
|
14
|
-
)
|
|
15
12
|
import scriptengine.yaml
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
from scriptengine.exceptions import (
|
|
14
|
+
ScriptEngineParseJinjaError,
|
|
15
|
+
ScriptEngineTaskArgumentInvalidError,
|
|
16
|
+
ScriptEngineTaskArgumentMissingError,
|
|
17
|
+
)
|
|
18
|
+
from scriptengine.yaml.noparse_strings import NoParseJinjaString, NoParseYamlString
|
|
20
19
|
|
|
21
20
|
_SENTINEL = object()
|
|
22
21
|
|
|
23
22
|
|
|
24
23
|
class Task:
|
|
25
|
-
|
|
26
24
|
_reg_name = None
|
|
27
|
-
_invalid_arguments = (
|
|
25
|
+
_invalid_arguments = (
|
|
26
|
+
"run",
|
|
27
|
+
"id",
|
|
28
|
+
)
|
|
28
29
|
|
|
29
30
|
@classmethod
|
|
30
31
|
def check_arguments(cls, arguments):
|
|
@@ -34,41 +35,38 @@ class Task:
|
|
|
34
35
|
ScriptEngineTaskArgumentMissingError.
|
|
35
36
|
"""
|
|
36
37
|
for name in arguments:
|
|
37
|
-
if name in getattr(cls,
|
|
38
|
-
logging.getLogger(
|
|
38
|
+
if name in getattr(cls, "_invalid_arguments", ()):
|
|
39
|
+
logging.getLogger("se.task").error(
|
|
39
40
|
(
|
|
40
41
|
f'Invalid argument "{name}" found while '
|
|
41
42
|
f'trying to create "{cls.__name__}" task'
|
|
42
43
|
),
|
|
43
|
-
extra={
|
|
44
|
+
extra={"id": "no id", "type": cls.__name__},
|
|
44
45
|
)
|
|
45
46
|
raise ScriptEngineTaskArgumentInvalidError
|
|
46
47
|
|
|
47
|
-
for name in getattr(cls,
|
|
48
|
+
for name in getattr(cls, "_required_arguments", ()):
|
|
48
49
|
if name not in arguments:
|
|
49
|
-
logging.getLogger(
|
|
50
|
+
logging.getLogger("se.task").error(
|
|
50
51
|
(
|
|
51
52
|
f'Missing required argument "{name}" while '
|
|
52
53
|
f'trying to create "{cls.__name__}" task'
|
|
53
54
|
),
|
|
54
|
-
extra={
|
|
55
|
+
extra={"id": "no id", "type": cls.__name__},
|
|
55
56
|
)
|
|
56
57
|
raise ScriptEngineTaskArgumentMissingError
|
|
57
58
|
|
|
58
59
|
def __init__(self, arguments=None):
|
|
59
|
-
|
|
60
60
|
self._identifier = uuid.uuid4()
|
|
61
61
|
|
|
62
62
|
if arguments is not None:
|
|
63
63
|
Task.check_arguments(arguments)
|
|
64
64
|
for name, value in arguments.items():
|
|
65
65
|
if hasattr(self, name):
|
|
66
|
-
self.log_error(
|
|
67
|
-
f'Invalid (reserved name) task argument: {name}'
|
|
68
|
-
)
|
|
66
|
+
self.log_error(f"Invalid (reserved name) task argument: {name}")
|
|
69
67
|
raise ScriptEngineTaskArgumentInvalidError
|
|
70
68
|
setattr(self, name, value)
|
|
71
|
-
self.log_debug(f
|
|
69
|
+
self.log_debug(f"Created task: {self}")
|
|
72
70
|
|
|
73
71
|
@classmethod
|
|
74
72
|
def register_name(cls, name):
|
|
@@ -76,8 +74,9 @@ class Task:
|
|
|
76
74
|
|
|
77
75
|
@property
|
|
78
76
|
def reg_name(self):
|
|
79
|
-
return
|
|
80
|
-
|
|
77
|
+
return (
|
|
78
|
+
self._reg_name or f"{self.__class__.__module__}:{self.__class__.__name__}"
|
|
79
|
+
)
|
|
81
80
|
|
|
82
81
|
@property
|
|
83
82
|
def id(self):
|
|
@@ -88,32 +87,33 @@ class Task:
|
|
|
88
87
|
return self._identifier.hex[:10]
|
|
89
88
|
|
|
90
89
|
def __repr__(self):
|
|
91
|
-
params = {
|
|
92
|
-
|
|
90
|
+
params = {
|
|
91
|
+
key: val
|
|
92
|
+
for key, val in self.__dict__.items()
|
|
93
|
+
if not (isinstance(key, str) and key.startswith("_"))
|
|
94
|
+
}
|
|
93
95
|
params_list = f'{", ".join([f"{k}={params[k]}" for k in params])}'
|
|
94
|
-
return f
|
|
96
|
+
return f"{self.__class__.__name__}({params_list})"
|
|
95
97
|
|
|
96
98
|
def run(self, context):
|
|
97
|
-
raise NotImplementedError(
|
|
98
|
-
'Base class function Task.run() must not be called'
|
|
99
|
-
)
|
|
99
|
+
raise NotImplementedError("Base class function Task.run() must not be called")
|
|
100
100
|
|
|
101
|
-
def getarg(
|
|
102
|
-
|
|
101
|
+
def getarg(
|
|
102
|
+
self, name, context={}, *, parse_jinja=True, parse_yaml=True, default=_SENTINEL
|
|
103
|
+
):
|
|
103
104
|
"""Returns the value of argument 'name'.
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
105
|
+
The argument value is parsed with Jinja2 and the given context,
|
|
106
|
+
unless 'parse_jinja' is False. The result is parsed once more with
|
|
107
|
+
the YAML parser in order to get a correctly typed result. If
|
|
108
|
+
parse_yaml is not True, the extra YAML parsing is skipped.
|
|
109
|
+
Parsing with Jinja/YAML is also skipped, if the argument value is a
|
|
110
|
+
string that starts with '_noparse_', '_noparsejinja_',
|
|
111
|
+
'_noparseyaml_', respectively.
|
|
112
|
+
If argument 'name' does not exist, the function raises an
|
|
113
|
+
AttributeError, unless a 'default' value is given.
|
|
114
|
+
"""
|
|
114
115
|
|
|
115
116
|
def parse(arg_):
|
|
116
|
-
|
|
117
117
|
# Recursively parse list items
|
|
118
118
|
if isinstance(arg_, list):
|
|
119
119
|
return [parse(item) for item in arg_]
|
|
@@ -123,14 +123,16 @@ class Task:
|
|
|
123
123
|
return dict((key, parse(val)) for key, val in arg_.items())
|
|
124
124
|
|
|
125
125
|
if isinstance(arg_, str):
|
|
126
|
-
if parse_jinja and
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
126
|
+
if parse_jinja and not isinstance(arg_, NoParseJinjaString):
|
|
127
|
+
try:
|
|
128
|
+
# Make sure that a NoParseString is still a NoParseString
|
|
129
|
+
# after this!
|
|
130
|
+
arg_ = type(arg_)(scriptengine.jinja.render(arg_, context))
|
|
131
|
+
except ScriptEngineParseJinjaError as e:
|
|
132
|
+
self.log_error(e)
|
|
133
|
+
raise ScriptEngineTaskArgumentInvalidError
|
|
134
|
+
|
|
135
|
+
if parse_yaml and not isinstance(arg_, NoParseYamlString):
|
|
134
136
|
try:
|
|
135
137
|
return yaml.full_load(arg_)
|
|
136
138
|
except (
|
|
@@ -138,9 +140,7 @@ class Task:
|
|
|
138
140
|
yaml.parser.ParserError,
|
|
139
141
|
yaml.constructor.ConstructorError,
|
|
140
142
|
):
|
|
141
|
-
self.log_debug(
|
|
142
|
-
f'Reparsing argument "{arg_}" with YAML failed'
|
|
143
|
-
)
|
|
143
|
+
self.log_debug(f'Reparsing argument "{arg_}" with YAML failed')
|
|
144
144
|
|
|
145
145
|
# Return plain strings, not NoParse*Strings
|
|
146
146
|
return str(arg_)
|
|
@@ -152,20 +152,14 @@ class Task:
|
|
|
152
152
|
arg = getattr(self, name)
|
|
153
153
|
except AttributeError:
|
|
154
154
|
if default is _SENTINEL:
|
|
155
|
-
self.log_error(
|
|
156
|
-
f'Trying to access missing task argument: {name}'
|
|
157
|
-
)
|
|
155
|
+
self.log_error(f"Trying to access missing task argument: {name}")
|
|
158
156
|
raise ScriptEngineTaskArgumentMissingError
|
|
159
157
|
arg = default
|
|
160
158
|
return parse(arg)
|
|
161
159
|
|
|
162
160
|
def _log(self, level, msg):
|
|
163
|
-
logger = logging.getLogger(
|
|
164
|
-
logger.log(
|
|
165
|
-
level,
|
|
166
|
-
msg,
|
|
167
|
-
extra={'type': self.reg_name, 'id': self.shortid}
|
|
168
|
-
)
|
|
161
|
+
logger = logging.getLogger("se.task")
|
|
162
|
+
logger.log(level, msg, extra={"type": self.reg_name, "id": self.shortid})
|
|
169
163
|
|
|
170
164
|
def log_debug(self, msg):
|
|
171
165
|
self._log(logging.DEBUG, msg)
|
scriptengine/yaml/parser.py
CHANGED
|
@@ -50,7 +50,7 @@ yaml.add_constructor("!rrule", rrule_constructor)
|
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
def parse(data):
|
|
53
|
-
"""Recursively parses data and returns a
|
|
53
|
+
"""Recursively parses data and returns a ScriptEngine Task or Job, or a list of those.
|
|
54
54
|
The data is supposed to come from YAML-parsing a ScriptEngine script."""
|
|
55
55
|
|
|
56
56
|
def build_job(todo, spec):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: scriptengine
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.0rc2
|
|
4
4
|
Summary: A lightweight and extensible framework for executing scripts written in YAML
|
|
5
5
|
Author-email: Uwe Fladrich <uwe.fladrich@protonmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/uwefladrich/scriptengine
|
|
@@ -8,14 +8,22 @@ Project-URL: Bug Tracker, https://github.com/uwefladrich/scriptengine/issues
|
|
|
8
8
|
Classifier: Programming Language :: Python :: 3
|
|
9
9
|
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
|
-
Requires-Python: >=3.
|
|
11
|
+
Requires-Python: >=3.8
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
14
|
Requires-Dist: python-dateutil
|
|
15
15
|
Requires-Dist: deepmerge
|
|
16
|
-
Requires-Dist: deepdiff (>=6.2.2)
|
|
17
16
|
Requires-Dist: PyYAML
|
|
18
17
|
Requires-Dist: jinja2
|
|
18
|
+
Provides-Extra: all
|
|
19
|
+
Requires-Dist: scriptengine[docs,tests] ; extra == 'all'
|
|
20
|
+
Provides-Extra: docs
|
|
21
|
+
Requires-Dist: sphinx ; extra == 'docs'
|
|
22
|
+
Requires-Dist: sphinx-rtd-theme ; extra == 'docs'
|
|
23
|
+
Provides-Extra: tests
|
|
24
|
+
Requires-Dist: coverage ; extra == 'tests'
|
|
25
|
+
Requires-Dist: coveralls ; extra == 'tests'
|
|
26
|
+
Requires-Dist: pytest ; extra == 'tests'
|
|
19
27
|
|
|
20
28
|
# ScriptEngine
|
|
21
29
|
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
scriptengine/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
scriptengine/context.py,sha256=
|
|
3
|
-
scriptengine/exceptions.py,sha256=
|
|
4
|
-
scriptengine/jinja.py,sha256=
|
|
5
|
-
scriptengine/jobs.py,sha256=
|
|
2
|
+
scriptengine/context.py,sha256=iXZuKOSssexHoh803UbKcV6hIxvd-CWI3agKFjwHgvs,3804
|
|
3
|
+
scriptengine/exceptions.py,sha256=boMFk6rzNVGQWsqE97bMvr8vBdz0tmsf3QPH4zc-3tk,1869
|
|
4
|
+
scriptengine/jinja.py,sha256=1XsN5RmDyOOpCnRJ7QkHWlPZ6KDHH6S177LBjNz4Z0w,4018
|
|
5
|
+
scriptengine/jobs.py,sha256=B8ev4SBMqagDuborCewjTB6b_-ugNXUGqvTIZQ3Klh8,5548
|
|
6
6
|
scriptengine/logging.py,sha256=9x0x5qF5BpGAAV8zWjwLX-T-2ZpVBv98qVN3c0uh4zY,3899
|
|
7
7
|
scriptengine/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
-
scriptengine/cli/se.py,sha256=
|
|
8
|
+
scriptengine/cli/se.py,sha256=CYoNGea7_PsT3VxnG3McRm_HFsATK8AX9rQ2tAJuxlY,5556
|
|
9
9
|
scriptengine/engines/__init__.py,sha256=DIbTKxMZrMcM9AAf_IDQrdL2g0__ZSxUlnVveOi-6qM,151
|
|
10
|
-
scriptengine/engines/simple_script_engine.py,sha256=
|
|
10
|
+
scriptengine/engines/simple_script_engine.py,sha256=R3BQO8AXAWsHMvQmCaQGRiLW1MnPih3hmtReBvglN4Y,3024
|
|
11
11
|
scriptengine/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
-
scriptengine/helpers/terminal_colors.py,sha256=
|
|
12
|
+
scriptengine/helpers/terminal_colors.py,sha256=QMKwVm2IIjjasRoM6qO5N7vJWG3iWjOEagAotU4k1S4,2862
|
|
13
13
|
scriptengine/tasks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
scriptengine/tasks/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
15
|
scriptengine/tasks/base/chdir.py,sha256=_oTtTPaJAn3DVyUPT3PS5Co9Viqw6pzDTnc5XWvYakE,500
|
|
16
|
-
scriptengine/tasks/base/command.py,sha256=
|
|
17
|
-
scriptengine/tasks/base/context.py,sha256=
|
|
16
|
+
scriptengine/tasks/base/command.py,sha256=g5JcRq9D5TUXbkFsREBIaAleoKDInFvpGCyZcVa44Lo,4916
|
|
17
|
+
scriptengine/tasks/base/context.py,sha256=UyOIB39Gg9ehdwzYA5kuDIwdZoaaTVjlDqwb-2KXLpo,3675
|
|
18
18
|
scriptengine/tasks/base/echo.py,sha256=oZ2WzK3NQhRgHAIspVJAP7ttEvTbL2hYdFlEUVczpxI,715
|
|
19
|
-
scriptengine/tasks/base/envvars.py,sha256=
|
|
19
|
+
scriptengine/tasks/base/envvars.py,sha256=ipQWKwPYM-1F_n1SmHskp3EbegYXtbzS1mtVtV9EqcE,1862
|
|
20
20
|
scriptengine/tasks/base/exit.py,sha256=VW2aimeBN_X9lnCvMHt9AlQRICbpeMLU9XuQ66tS5PI,474
|
|
21
|
-
scriptengine/tasks/base/find.py,sha256=
|
|
22
|
-
scriptengine/tasks/base/include.py,sha256=
|
|
21
|
+
scriptengine/tasks/base/find.py,sha256=6HeBlfJJvipm1I5mkL4en6VvM1WfBtbq7mugo9qg974,2293
|
|
22
|
+
scriptengine/tasks/base/include.py,sha256=f5xK_w5bA30YHlKpGy0MJGRmVaIxzX5tbq5wmpu_Swc,2361
|
|
23
23
|
scriptengine/tasks/base/task_timer.py,sha256=SOnqGjJQTmLR-3aJgMx9za4Qj25-RB-PSzwpTuqROXQ,2438
|
|
24
|
-
scriptengine/tasks/base/template.py,sha256=
|
|
24
|
+
scriptengine/tasks/base/template.py,sha256=D4elTuw-CCno208-307K_-JwtmGnhnI-yV-YVfjF-e8,2397
|
|
25
25
|
scriptengine/tasks/base/time.py,sha256=0dAYFqz3hIzoUzZfGa9rZprQ2SyiOzsJZg2rjsxFASw,868
|
|
26
26
|
scriptengine/tasks/base/file/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
27
27
|
scriptengine/tasks/base/file/copy.py,sha256=bmYApDJTTEtbOS-hFb41i1h9f4gXImTDbBOICYsS3A0,2874
|
|
@@ -30,15 +30,15 @@ scriptengine/tasks/base/file/make_dir.py,sha256=r--aUZ9GtSpjAyJ5HxEcsWJ-Syg-6NtL
|
|
|
30
30
|
scriptengine/tasks/base/file/move.py,sha256=ZFEDGtn_jhjQ9yPIriq4xuOEa5jxlpLzX65VAI9Orcc,2620
|
|
31
31
|
scriptengine/tasks/base/file/remove.py,sha256=en7grY13x7T2hLXHgMBUC1oQDVNDKw_pHAFdQ4_rZyQ,2631
|
|
32
32
|
scriptengine/tasks/core/__init__.py,sha256=GNnJZ5Iczsqy0j69fUEou4OOsVyIzdKm9Ym5_rzvL8E,463
|
|
33
|
-
scriptengine/tasks/core/loader.py,sha256=
|
|
34
|
-
scriptengine/tasks/core/task.py,sha256=
|
|
33
|
+
scriptengine/tasks/core/loader.py,sha256=zS_a_WhAVCGU-LnEJQpEQZuQP-dR5LIg4REB3MoAhcM,1546
|
|
34
|
+
scriptengine/tasks/core/task.py,sha256=IeNcnBh-JjC-5K8CkU1JsYn-ppjBnzBL6xf96i1-NwM,6149
|
|
35
35
|
scriptengine/tasks/core/timing.py,sha256=dszR5IMDOM0tD1rKzV__x6hpFIr8QqvLxjwy604nE1k,1868
|
|
36
36
|
scriptengine/yaml/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
37
37
|
scriptengine/yaml/noparse_strings.py,sha256=-S7r9B3Z60OdFqKhH3FKxu_NAmiMSvdLhqh1jm_pS4c,360
|
|
38
|
-
scriptengine/yaml/parser.py,sha256=
|
|
39
|
-
scriptengine-0.
|
|
40
|
-
scriptengine-0.
|
|
41
|
-
scriptengine-0.
|
|
42
|
-
scriptengine-0.
|
|
43
|
-
scriptengine-0.
|
|
44
|
-
scriptengine-0.
|
|
38
|
+
scriptengine/yaml/parser.py,sha256=rGZ-TDfs8FTHaKFdlNsKx2R_9p8vUpxaxhbqDb5tg18,4394
|
|
39
|
+
scriptengine-1.0.0rc2.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
40
|
+
scriptengine-1.0.0rc2.dist-info/METADATA,sha256=D88QnzdFJGCLSp7YVN089ZJL2Y3Gt13Z0vDqQMjvlHA,3497
|
|
41
|
+
scriptengine-1.0.0rc2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
42
|
+
scriptengine-1.0.0rc2.dist-info/entry_points.txt,sha256=I86m88o6_1m5xFetaFyQ3RG7VSoP6X75--tohirKAyw,1031
|
|
43
|
+
scriptengine-1.0.0rc2.dist-info/top_level.txt,sha256=NJtb69qOcNOBwMfieKzfKhGpGKUiu3fXszSucQPP374,13
|
|
44
|
+
scriptengine-1.0.0rc2.dist-info/RECORD,,
|
|
@@ -20,21 +20,3 @@ base.setenv = scriptengine.tasks.base.envvars:Setenv
|
|
|
20
20
|
base.task_timer = scriptengine.tasks.base.task_timer:TaskTimer
|
|
21
21
|
base.template = scriptengine.tasks.base.template:Template
|
|
22
22
|
base.time = scriptengine.tasks.base.time:Time
|
|
23
|
-
chdir = scriptengine.tasks.base.chdir:Chdir
|
|
24
|
-
command = scriptengine.tasks.base.command:Command
|
|
25
|
-
context = scriptengine.tasks.base.context:Context
|
|
26
|
-
context.from = scriptengine.tasks.base.context:ContextFrom
|
|
27
|
-
copy = scriptengine.tasks.base.file.copy:Copy
|
|
28
|
-
echo = scriptengine.tasks.base.echo:Echo
|
|
29
|
-
exit = scriptengine.tasks.base.exit:Exit
|
|
30
|
-
find = scriptengine.tasks.base.find:Find
|
|
31
|
-
getenv = scriptengine.tasks.base.envvars:Getenv
|
|
32
|
-
include = scriptengine.tasks.base.include:Include
|
|
33
|
-
link = scriptengine.tasks.base.file.link:Link
|
|
34
|
-
make_dir = scriptengine.tasks.base.file.make_dir:MakeDir
|
|
35
|
-
move = scriptengine.tasks.base.file.move:Move
|
|
36
|
-
remove = scriptengine.tasks.base.file.remove:Remove
|
|
37
|
-
setenv = scriptengine.tasks.base.envvars:Setenv
|
|
38
|
-
task_timer = scriptengine.tasks.base.task_timer:TaskTimer
|
|
39
|
-
template = scriptengine.tasks.base.template:Template
|
|
40
|
-
time = scriptengine.tasks.base.time:Time
|
|
File without changes
|
|
File without changes
|