dekshell 0.2.9__tar.gz → 0.2.11__tar.gz
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-0.2.9 → dekshell-0.2.11}/PKG-INFO +1 -1
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/core/contexts/methods.py +4 -2
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/core/markers/__init__.py +1 -1
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/core/markers/input.py +14 -2
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/utils/cmd.py +1 -1
- {dekshell-0.2.9 → dekshell-0.2.11}/pyproject.toml +1 -1
- {dekshell-0.2.9 → dekshell-0.2.11}/README.md +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/__init__.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/click/__entry__.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/click/__init__.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/core/__init__.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/core/contexts/__init__.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/core/contexts/properties.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/core/markers/base/__init__.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/core/markers/base/core.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/core/markers/commands.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/core/markers/comment.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/core/markers/define.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/core/markers/echo.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/core/markers/empty.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/core/markers/env.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/core/markers/exec.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/core/markers/for_.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/core/markers/function.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/core/markers/if_.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/core/markers/invoke.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/core/markers/pip_.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/core/markers/redirect.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/core/markers/shell.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/core/markers/var.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/core/markers/while_.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/core/plugin/__init__.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/core/redirect.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/utils/__init__.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/utils/beep.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/utils/pkg.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/utils/serializer.py +0 -0
- {dekshell-0.2.9 → dekshell-0.2.11}/dekshell/utils/shell.py +0 -0
|
@@ -26,6 +26,7 @@ from dektools.shell import shell_wrapper, is_user_admin
|
|
|
26
26
|
from dektools.match import GeneralMatcher, glob2re, glob_compile, glob_match
|
|
27
27
|
from dektools.cmd.git import git_clean_dir, git_apply, git_parse_modules, git_fetch_min, git_list_remotes, git_head
|
|
28
28
|
from ...utils.beep import sound_notify
|
|
29
|
+
from ...utils.cmd import ak2cmd
|
|
29
30
|
from ..markers.base.core import MarkerBase, get_inner_vars
|
|
30
31
|
from ..markers.invoke import InvokeMarker, GotoMarker
|
|
31
32
|
from ..redirect import search_bin_by_path_tree
|
|
@@ -214,7 +215,8 @@ default_methods = {
|
|
|
214
215
|
},
|
|
215
216
|
|
|
216
217
|
'sys': {
|
|
217
|
-
'utf8': lambda: sys.stdout.reconfigure(encoding='utf-8')
|
|
218
|
+
'utf8': lambda: sys.stdout.reconfigure(encoding='utf-8'),
|
|
219
|
+
'ak': ak2cmd,
|
|
218
220
|
},
|
|
219
221
|
|
|
220
222
|
'compress': compress_files,
|
|
@@ -223,7 +225,7 @@ default_methods = {
|
|
|
223
225
|
'func': FuncAnyArgs,
|
|
224
226
|
|
|
225
227
|
'me': lambda x: x,
|
|
226
|
-
'first': lambda x: x
|
|
228
|
+
'first': lambda x, default=None: next(iter(x), default),
|
|
227
229
|
'true': lambda x=True: _is_true(x),
|
|
228
230
|
'false': lambda x=False: not _is_true(x),
|
|
229
231
|
|
|
@@ -24,7 +24,7 @@ def generate_markers(*args, **kwargs):
|
|
|
24
24
|
*args,
|
|
25
25
|
*get_markers_from_modules(**kwargs),
|
|
26
26
|
ErrorEchoMarker, EchoNoWrapMarker, EchoMarker,
|
|
27
|
-
InputMarker,
|
|
27
|
+
InputMarker, InputOnceMarker,
|
|
28
28
|
DelVarMarker,
|
|
29
29
|
ExecLinesUpdateMarker, ExecLinesMarker, ExecMarker, ExecCmdcallSimpleLinesMarker, ExecCmdcallLinesMarker,
|
|
30
30
|
ExecCmdcallMarker, ExecCmdcallChainMarker,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import subprocess
|
|
2
|
-
from dektools.shell import shell_with_input
|
|
2
|
+
from dektools.shell import shell_with_input, shell_with_input_once
|
|
3
3
|
from .base import MarkerWithEnd, MarkerNoTranslator
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
class InputMarker(MarkerWithEnd, MarkerNoTranslator):
|
|
7
|
-
tag_head = '
|
|
7
|
+
tag_head = 'inputs'
|
|
8
8
|
|
|
9
9
|
def execute(self, context, command, marker_node, marker_set):
|
|
10
10
|
command_text = self.get_inner_content(context, marker_node, sep='', translate=True).strip()
|
|
@@ -14,3 +14,15 @@ class InputMarker(MarkerWithEnd, MarkerNoTranslator):
|
|
|
14
14
|
if rc:
|
|
15
15
|
raise subprocess.CalledProcessError(rc, command_text)
|
|
16
16
|
return []
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class InputOnceMarker(MarkerWithEnd, MarkerNoTranslator):
|
|
20
|
+
tag_head = 'input'
|
|
21
|
+
|
|
22
|
+
def execute(self, context, command, marker_node, marker_set):
|
|
23
|
+
command_text = self.get_inner_content(context, marker_node, sep='', translate=True).strip()
|
|
24
|
+
inputs = self.split_raw(command, 1, self.tag_head)[1]
|
|
25
|
+
rc = shell_with_input_once(command_text, inputs, env=context.environ_full())[0]
|
|
26
|
+
if rc:
|
|
27
|
+
raise subprocess.CalledProcessError(rc, command_text)
|
|
28
|
+
return []
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|