dekshell 0.2.25__py3-none-any.whl → 0.2.26__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.
- dekshell/click/__entry__.py +4 -0
- dekshell/core/__init__.py +7 -6
- dekshell/core/contexts/methods.py +3 -3
- dekshell/core/markers/base/__init__.py +3 -3
- dekshell/core/markers/base/core.py +2 -2
- dekshell/core/markers/base/shell.py +1 -1
- dekshell/utils/cmd.py +4 -3
- {dekshell-0.2.25.dist-info → dekshell-0.2.26.dist-info}/METADATA +1 -1
- {dekshell-0.2.25.dist-info → dekshell-0.2.26.dist-info}/RECORD +11 -11
- {dekshell-0.2.25.dist-info → dekshell-0.2.26.dist-info}/WHEEL +0 -0
- {dekshell-0.2.25.dist-info → dekshell-0.2.26.dist-info}/entry_points.txt +0 -0
dekshell/click/__entry__.py
CHANGED
dekshell/core/__init__.py
CHANGED
|
@@ -37,11 +37,11 @@ def shell_command_file(filepath, **kwargs):
|
|
|
37
37
|
filepath = normal_path(filepath, unix=True)
|
|
38
38
|
with codecs.open(filepath, encoding='utf-8') as f:
|
|
39
39
|
kwargs['source'] = dict(desc=filepath)
|
|
40
|
-
kwargs['context'] = (kwargs.get('context') or {})
|
|
40
|
+
kwargs['context'] = {**(kwargs.get('context') or {}), **dict(
|
|
41
41
|
fp=filepath,
|
|
42
42
|
fpp=os.path.dirname(filepath),
|
|
43
43
|
fpy=seek_py_module_path(filepath),
|
|
44
|
-
)
|
|
44
|
+
)}
|
|
45
45
|
return shell_command_batch(f.read(), **kwargs)
|
|
46
46
|
|
|
47
47
|
|
|
@@ -56,9 +56,10 @@ default_configs = {
|
|
|
56
56
|
'descper': dict(desc_begin_per=True, desc_took_per=True),
|
|
57
57
|
'source': lambda src: dict(source=dict(desc=src))
|
|
58
58
|
}
|
|
59
|
-
default_configs
|
|
60
|
-
|
|
61
|
-
'
|
|
59
|
+
default_configs = {
|
|
60
|
+
**default_configs,
|
|
61
|
+
'notify': {**default_configs['beep'], **default_configs['deschead']},
|
|
62
|
+
'notifyper': {**default_configs['beep'], **default_configs['deschead'], **default_configs['descper']},
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
|
|
@@ -114,7 +115,7 @@ def shell_command_batch_core(
|
|
|
114
115
|
generate_markers(*(marker or []), **(plugin_kwargs or {})),
|
|
115
116
|
shell_exec, shell_cmd
|
|
116
117
|
)
|
|
117
|
-
context_final = get_all_context()
|
|
118
|
+
context_final = {**get_all_context(), **(context or {})}
|
|
118
119
|
tz = get_tz(tz)
|
|
119
120
|
ts_begin = time.time()
|
|
120
121
|
commands, ln = _get_commands(commands)
|
|
@@ -217,9 +217,9 @@ default_methods = {
|
|
|
217
217
|
'io': _io,
|
|
218
218
|
'reduce': reduce,
|
|
219
219
|
'chain': chain,
|
|
220
|
-
'echo': lambda *x, **y: print(*x, **dict(flush=True)
|
|
221
|
-
'echos': lambda *x, **y: print(*x, **dict(end='', flush=True)
|
|
222
|
-
'echox': lambda *x, **y: print(*x, **dict(file=sys.stderr, flush=True)
|
|
220
|
+
'echo': lambda *x, **y: print(*x, **{**dict(flush=True), **y}),
|
|
221
|
+
'echos': lambda *x, **y: print(*x, **{**dict(end='', flush=True), **y}),
|
|
222
|
+
'echox': lambda *x, **y: print(*x, **{**dict(file=sys.stderr, flush=True), **y}),
|
|
223
223
|
'pprint': pprint,
|
|
224
224
|
'o2s': obj2str,
|
|
225
225
|
'now': now,
|
|
@@ -235,7 +235,7 @@ class MarkerBase:
|
|
|
235
235
|
def eval(context, s, v=None):
|
|
236
236
|
if not s:
|
|
237
237
|
return None
|
|
238
|
-
return eval(s, context.variables_full()
|
|
238
|
+
return eval(s, {**context.variables_full(), **(v or {})})
|
|
239
239
|
|
|
240
240
|
@classmethod
|
|
241
241
|
def eval_mixin(cls, context, expression, translate=True):
|
|
@@ -278,7 +278,7 @@ class MarkerBase:
|
|
|
278
278
|
|
|
279
279
|
@staticmethod
|
|
280
280
|
def eval_lines(context, s, v=None):
|
|
281
|
-
globals_ = context.variables_full()
|
|
281
|
+
globals_ = {**context.variables_full(), **(v or {})}
|
|
282
282
|
locals_ = {}
|
|
283
283
|
exec(s, globals_, locals_)
|
|
284
284
|
return locals_
|
|
@@ -402,7 +402,7 @@ class MarkerShellBase(MarkerBase):
|
|
|
402
402
|
|
|
403
403
|
@classmethod
|
|
404
404
|
def execute_core(cls, context, command, marker_node, marker_set, kwargs=None):
|
|
405
|
-
kwargs = (marker_node.payload or {})
|
|
405
|
+
kwargs = {**(marker_node.payload or {}), **(kwargs or {})}
|
|
406
406
|
return marker_set.shell_cmd(command, cls.shell_cls(kwargs), env=context.environ_full())
|
|
407
407
|
|
|
408
408
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import sys
|
|
3
|
-
from types import NoneType
|
|
4
3
|
from dektools.output import obj2str
|
|
5
4
|
from dektools.str import hex_random
|
|
6
5
|
from dektools.dict import MapChainContext
|
|
6
|
+
from dektools.typing import NoneType
|
|
7
7
|
from . import MarkerBase, TransformerMarker, ExitException, QuitContextException
|
|
8
8
|
|
|
9
9
|
|
|
@@ -350,6 +350,6 @@ class MarkerSet:
|
|
|
350
350
|
try:
|
|
351
351
|
root = self.generate_tree(commands, ln)
|
|
352
352
|
return root.execute(
|
|
353
|
-
self.context_cls().update_variables((context or {})
|
|
353
|
+
self.context_cls().update_variables({**(context or {}), **dict(__inner_marker_set__=self)}), self)
|
|
354
354
|
except ExitException:
|
|
355
355
|
pass
|
dekshell/utils/cmd.py
CHANGED
|
@@ -34,12 +34,13 @@ def ak2cmd(args=None, kwargs=None):
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
def pack_context(args, kwargs):
|
|
37
|
-
return {
|
|
37
|
+
return {
|
|
38
|
+
**{f'{key_arg}{i}': arg for i, arg in enumerate(args)}, **{key_args: tuple(args), key_kwargs: kwargs}, **kwargs}
|
|
38
39
|
|
|
39
40
|
|
|
40
41
|
def pack_context_argv():
|
|
41
|
-
return {f"{key_argv}{i}": x for i, x in enumerate(sys.argv)}
|
|
42
|
+
return {**{f"{key_argv}{i}": x for i, x in enumerate(sys.argv)}, **{key_argv: sys.argv}}
|
|
42
43
|
|
|
43
44
|
|
|
44
45
|
def pack_context_full(args=None, kwargs=None):
|
|
45
|
-
return pack_context(args or [], kwargs or {})
|
|
46
|
+
return {**pack_context(args or [], kwargs or {}), **pack_context_argv()}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
dekshell-0.2.
|
|
2
|
-
dekshell-0.2.
|
|
3
|
-
dekshell-0.2.
|
|
1
|
+
dekshell-0.2.26.dist-info/METADATA,sha256=jKY1znFqUZbTul0uoKqPFnEz0J-3F3FgvypZomH-sQM,573
|
|
2
|
+
dekshell-0.2.26.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
|
|
3
|
+
dekshell-0.2.26.dist-info/entry_points.txt,sha256=d-kbfULiUTZWIBBsrQF3J_-wESncF-4K2rwHT08grlI,75
|
|
4
4
|
dekshell/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
-
dekshell/click/__entry__.py,sha256=
|
|
5
|
+
dekshell/click/__entry__.py,sha256=fFvrYPXiTLxLS7XLPLPHy_DYTcNE7XL_LZUcVHfIrjA,82
|
|
6
6
|
dekshell/click/__init__.py,sha256=rFzB_exzPQaIcbbms5PdHAU3NGdl2MBaYbq9v7g7BOI,1870
|
|
7
|
-
dekshell/core/__init__.py,sha256=
|
|
7
|
+
dekshell/core/__init__.py,sha256=7d3AjVUGIjXIXRYYiJ03rz5ZONTTojmGfgwpjGmKqtU,5448
|
|
8
8
|
dekshell/core/contexts/__init__.py,sha256=ynsfv37azOKfI2UKd0iPl2M6iBW-k5cb1BqSLOWuJpI,482
|
|
9
|
-
dekshell/core/contexts/methods.py,sha256=
|
|
9
|
+
dekshell/core/contexts/methods.py,sha256=ksoOgBHDRM6uiGHw3ubCk4x7ExJKvJ6H3eGhaM-SNDE,9722
|
|
10
10
|
dekshell/core/contexts/properties.py,sha256=esr51c6wDTDsuFXF2uj7WfyIGSq9H0dzqDqWzeMTNQE,2382
|
|
11
11
|
dekshell/core/markers/__init__.py,sha256=_HJsxjjsyYbL7Pj6jhoeJ1WJI92qwCbdl-BKvQcGHlA,1949
|
|
12
|
-
dekshell/core/markers/base/__init__.py,sha256=
|
|
13
|
-
dekshell/core/markers/base/core.py,sha256=
|
|
14
|
-
dekshell/core/markers/base/shell.py,sha256=
|
|
12
|
+
dekshell/core/markers/base/__init__.py,sha256=8WQ1b4J9JBjcPmgAPz5gmXbUf2WgGG41XrktRAvoW-A,13744
|
|
13
|
+
dekshell/core/markers/base/core.py,sha256=LW1KiJBaRhXFOswpChRB9K7VvGQdY1H84wcr-8L9i-k,11582
|
|
14
|
+
dekshell/core/markers/base/shell.py,sha256=fiFsTUDI8pSDDUCk834OI4ajri2qNWFJkLVhmUk2uAs,484
|
|
15
15
|
dekshell/core/markers/commands.py,sha256=mDRj4dSfKbDaZ_ts4lPXd6wftvGFI4VKkRoIzxV7otA,1696
|
|
16
16
|
dekshell/core/markers/comment.py,sha256=28iccgLs_0bRdXLhHyQR2I_kzlWdeMSqqNUFW-2vkes,818
|
|
17
17
|
dekshell/core/markers/define.py,sha256=LpMSfz9ziXq2aFJ6oMpUFFo93TpBx7GxKYNzCeht4fQ,516
|
|
@@ -33,8 +33,8 @@ dekshell/core/plugin/__init__.py,sha256=jAB_KnnHJsyJR_zIfBU_HNLngyhcyyqVv05PdlNZ
|
|
|
33
33
|
dekshell/core/redirect.py,sha256=6YCJpG0TkQ4WMt7LBtDD_W1T-C-QkLtGRQw0S60qe54,1058
|
|
34
34
|
dekshell/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
35
35
|
dekshell/utils/beep.py,sha256=teuQgHbWDr8BD1xCJ4Pt79X6N1-eq1tTlyGunK6wBIM,120
|
|
36
|
-
dekshell/utils/cmd.py,sha256=
|
|
36
|
+
dekshell/utils/cmd.py,sha256=A0lEixQ7Ui0UxmeuymniyqCZXss9qQdX1C0COM7EEkQ,1234
|
|
37
37
|
dekshell/utils/pkg.py,sha256=TgYqRqawoJfjkxt6UAHnp9ttmpjuHiWRFbqxADOS1VE,1337
|
|
38
38
|
dekshell/utils/serializer.py,sha256=aIdF2Wzo-qHmIshv46jn1XD0X66vQ1JFdU-g3ZFbH2w,386
|
|
39
39
|
dekshell/utils/shell.py,sha256=0NoA2-SOOMinbmZZipwzL-npBbzPOdWEfdPVYqq5G5g,92
|
|
40
|
-
dekshell-0.2.
|
|
40
|
+
dekshell-0.2.26.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|