ae-shell 0.3.14__tar.gz → 0.3.15__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.
- {ae_shell-0.3.14 → ae_shell-0.3.15}/LICENSE.md +1 -1
- {ae_shell-0.3.14/ae_shell.egg-info → ae_shell-0.3.15}/PKG-INFO +18 -12
- {ae_shell-0.3.14 → ae_shell-0.3.15}/README.md +17 -11
- {ae_shell-0.3.14 → ae_shell-0.3.15}/ae/shell.py +12 -11
- {ae_shell-0.3.14 → ae_shell-0.3.15/ae_shell.egg-info}/PKG-INFO +18 -12
- {ae_shell-0.3.14 → ae_shell-0.3.15}/pyproject.toml +1 -1
- {ae_shell-0.3.14 → ae_shell-0.3.15}/setup.py +2 -2
- {ae_shell-0.3.14 → ae_shell-0.3.15}/ae_shell.egg-info/SOURCES.txt +0 -0
- {ae_shell-0.3.14 → ae_shell-0.3.15}/ae_shell.egg-info/dependency_links.txt +0 -0
- {ae_shell-0.3.14 → ae_shell-0.3.15}/ae_shell.egg-info/requires.txt +0 -0
- {ae_shell-0.3.14 → ae_shell-0.3.15}/ae_shell.egg-info/top_level.txt +0 -0
- {ae_shell-0.3.14 → ae_shell-0.3.15}/ae_shell.egg-info/zip-safe +0 -0
- {ae_shell-0.3.14 → ae_shell-0.3.15}/setup.cfg +0 -0
- {ae_shell-0.3.14 → ae_shell-0.3.15}/tests/test_shell.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ae_shell
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.15
|
|
4
4
|
Summary: ae namespace module portion shell: shell execution and environment helpers
|
|
5
5
|
Home-page: https://gitlab.com/ae-group/ae_shell
|
|
6
6
|
Author: AndiEcker
|
|
@@ -62,15 +62,15 @@ Dynamic: requires-dist
|
|
|
62
62
|
Dynamic: requires-python
|
|
63
63
|
Dynamic: summary
|
|
64
64
|
|
|
65
|
-
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.
|
|
66
|
-
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.
|
|
67
|
-
# shell 0.3.
|
|
65
|
+
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.104 -->
|
|
66
|
+
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.31 -->
|
|
67
|
+
# shell 0.3.15
|
|
68
68
|
|
|
69
69
|
[](
|
|
70
70
|
https://gitlab.com/ae-group/ae_shell)
|
|
71
71
|
[](
|
|
73
|
+
https://gitlab.com/ae-group/ae_shell/-/tree/release0.3.15)
|
|
74
74
|
[](
|
|
75
75
|
https://pypi.org/project/ae-shell/#history)
|
|
76
76
|
|
|
@@ -99,8 +99,8 @@ Dynamic: summary
|
|
|
99
99
|
https://pypi.org/project/ae-shell/#files)
|
|
100
100
|
|
|
101
101
|
|
|
102
|
-
## installation
|
|
103
102
|
|
|
103
|
+
## installation
|
|
104
104
|
|
|
105
105
|
execute the following command to install the
|
|
106
106
|
ae.shell module
|
|
@@ -121,10 +121,14 @@ following command in the root folder of this repository
|
|
|
121
121
|
pip install --editable .[dev]
|
|
122
122
|
```
|
|
123
123
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
this command installs this module portion project
|
|
125
|
+
along with the necessary tools to modify the source code,
|
|
126
|
+
run unit tests, and build documentation. to install only
|
|
127
|
+
the dependencies required for a specific task, replace
|
|
128
|
+
`dev` with one of the following:
|
|
129
|
+
|
|
130
|
+
* `tests`: for contributing to the unit test suite
|
|
131
|
+
* `docs`: for maintaining and building documentation
|
|
128
132
|
|
|
129
133
|
more detailed explanations on how to contribute to this project
|
|
130
134
|
[are available here](
|
|
@@ -133,7 +137,9 @@ https://gitlab.com/ae-group/ae_shell/-/blob/develop/CONTRIBUTING.rst)
|
|
|
133
137
|
|
|
134
138
|
## namespace portion documentation
|
|
135
139
|
|
|
136
|
-
|
|
140
|
+
the documentation of the source code of this portion is available at
|
|
137
141
|
[ReadTheDocs](
|
|
138
142
|
https://ae.readthedocs.io/en/latest/_autosummary/ae.shell.html
|
|
139
143
|
"ae_shell documentation").
|
|
144
|
+
|
|
145
|
+
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.
|
|
2
|
-
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.
|
|
3
|
-
# shell 0.3.
|
|
1
|
+
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.104 -->
|
|
2
|
+
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.31 -->
|
|
3
|
+
# shell 0.3.15
|
|
4
4
|
|
|
5
5
|
[](
|
|
6
6
|
https://gitlab.com/ae-group/ae_shell)
|
|
7
7
|
[](
|
|
9
|
+
https://gitlab.com/ae-group/ae_shell/-/tree/release0.3.15)
|
|
10
10
|
[](
|
|
11
11
|
https://pypi.org/project/ae-shell/#history)
|
|
12
12
|
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
https://pypi.org/project/ae-shell/#files)
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
## installation
|
|
39
38
|
|
|
39
|
+
## installation
|
|
40
40
|
|
|
41
41
|
execute the following command to install the
|
|
42
42
|
ae.shell module
|
|
@@ -57,10 +57,14 @@ following command in the root folder of this repository
|
|
|
57
57
|
pip install --editable .[dev]
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
this command installs this module portion project
|
|
61
|
+
along with the necessary tools to modify the source code,
|
|
62
|
+
run unit tests, and build documentation. to install only
|
|
63
|
+
the dependencies required for a specific task, replace
|
|
64
|
+
`dev` with one of the following:
|
|
65
|
+
|
|
66
|
+
* `tests`: for contributing to the unit test suite
|
|
67
|
+
* `docs`: for maintaining and building documentation
|
|
64
68
|
|
|
65
69
|
more detailed explanations on how to contribute to this project
|
|
66
70
|
[are available here](
|
|
@@ -69,7 +73,9 @@ https://gitlab.com/ae-group/ae_shell/-/blob/develop/CONTRIBUTING.rst)
|
|
|
69
73
|
|
|
70
74
|
## namespace portion documentation
|
|
71
75
|
|
|
72
|
-
|
|
76
|
+
the documentation of the source code of this portion is available at
|
|
73
77
|
[ReadTheDocs](
|
|
74
78
|
https://ae.readthedocs.io/en/latest/_autosummary/ae.shell.html
|
|
75
79
|
"ae_shell documentation").
|
|
80
|
+
|
|
81
|
+
|
|
@@ -23,8 +23,9 @@ import os
|
|
|
23
23
|
import shlex
|
|
24
24
|
import subprocess
|
|
25
25
|
|
|
26
|
+
from collections.abc import Callable, Iterable, Iterator, MutableMapping
|
|
26
27
|
from contextlib import contextmanager
|
|
27
|
-
from typing import Any,
|
|
28
|
+
from typing import Any, cast, overload
|
|
28
29
|
|
|
29
30
|
from ae.base import UNSET, dummy_function, env_str, norm_name # type: ignore
|
|
30
31
|
from ae.system import load_env_var_defaults # type: ignore
|
|
@@ -32,14 +33,14 @@ from ae.core import main_app_instance, AppBase
|
|
|
32
33
|
from ae.console import MAIN_SECTION_NAME, ConsoleApp # type: ignore
|
|
33
34
|
|
|
34
35
|
|
|
35
|
-
__version__ = '0.3.
|
|
36
|
+
__version__ = '0.3.15'
|
|
36
37
|
|
|
37
38
|
|
|
38
39
|
STDERR_BEG_MARKER = "vvv STDERR vvv" #: :paramref:`ae.shell.sh_exec.lines_output` begin stderr lines
|
|
39
40
|
STDERR_END_MARKER = "^^^ STDERR ^^^" #: end stderr lines in :paramref:`ae.shell.sh_exec.lines_output`
|
|
40
41
|
|
|
41
42
|
|
|
42
|
-
def debug_or_verbose(app_obj:
|
|
43
|
+
def debug_or_verbose(app_obj: ConsoleApp | None = None) -> bool:
|
|
43
44
|
""" determine if the current app runs in debug|verbose mode, while preventing early .get_option() call an app init.
|
|
44
45
|
|
|
45
46
|
:param app_obj: optional ConsoleApp instance (def=main_app_instance()).
|
|
@@ -86,7 +87,7 @@ def get_domain_user_var(variable_name: str, domain: str = "", user: str = "") ->
|
|
|
86
87
|
return value
|
|
87
88
|
|
|
88
89
|
|
|
89
|
-
def hint(command: str, action:
|
|
90
|
+
def hint(command: str, action: Callable | str, message_suffix: str = "") -> str:
|
|
90
91
|
""" return hint string in debug/verbose mode, to be appended onto a shell/console output.
|
|
91
92
|
|
|
92
93
|
:param command: shell command.
|
|
@@ -123,7 +124,7 @@ def mask_token(text: str) -> str: ...
|
|
|
123
124
|
def mask_token(text: list[str]) -> list[str]: ...
|
|
124
125
|
|
|
125
126
|
|
|
126
|
-
def mask_token(text:
|
|
127
|
+
def mask_token(text: str | list[str]) -> str | list[str]:
|
|
127
128
|
""" hide most parts of any Codeberg/GitHub/GitHub URL tokens found in the specified text/-lines.
|
|
128
129
|
|
|
129
130
|
:param text: text, specified either as str object or as a list of str objects (lines),
|
|
@@ -153,8 +154,8 @@ def mask_token(text: Union[str, list[str]]) -> Union[str, list[str]]:
|
|
|
153
154
|
|
|
154
155
|
# pylint: disable-next=too-many-arguments,too-many-positional-arguments
|
|
155
156
|
def sh_exec(command_line: str, extra_args: Iterable[str] = (), console_input: str = "",
|
|
156
|
-
lines_output:
|
|
157
|
-
env_vars:
|
|
157
|
+
lines_output: list[str] | None = None, app_obj: AppBase | None = None, shell: bool = False,
|
|
158
|
+
env_vars: dict[str, str] | None = None) -> int:
|
|
158
159
|
""" execute command in the current working directory of the OS console/shell.
|
|
159
160
|
|
|
160
161
|
:param command_line: command line string to execute on the console/shell. could contain command line args
|
|
@@ -181,7 +182,7 @@ def sh_exec(command_line: str, extra_args: Iterable[str] = (), console_input: st
|
|
|
181
182
|
debug_out = app_obj.dpo if app_obj else dummy_function if app_obj is UNSET else print
|
|
182
183
|
debug_out(f" . executing at {os.getcwd()}: {mask_token(args)}")
|
|
183
184
|
|
|
184
|
-
result:
|
|
185
|
+
result: subprocess.CompletedProcess | subprocess.CalledProcessError # having: stdout/stderr/returncode
|
|
185
186
|
try:
|
|
186
187
|
result = subprocess.run(args,
|
|
187
188
|
stdout=subprocess.PIPE if ret_out else None,
|
|
@@ -211,9 +212,9 @@ def sh_exec(command_line: str, extra_args: Iterable[str] = (), console_input: st
|
|
|
211
212
|
|
|
212
213
|
# pylint: disable-next=too-many-arguments,too-many-positional-arguments
|
|
213
214
|
def sh_exit_if_exec_err(err_code: int, command_line: str,
|
|
214
|
-
extra_args: Iterable[str] = (), lines_output:
|
|
215
|
-
exit_on_err: bool = True, exit_msg: str = "", app_obj:
|
|
216
|
-
shell: bool = False, env_vars:
|
|
215
|
+
extra_args: Iterable[str] = (), lines_output: list[str] | None = None,
|
|
216
|
+
exit_on_err: bool = True, exit_msg: str = "", app_obj: ConsoleApp | None = None,
|
|
217
|
+
shell: bool = False, env_vars: dict[str, str] | None = None) -> int:
|
|
217
218
|
""" execute command in the current working directory of the OS console/shell, dump error, and exit app if needed.
|
|
218
219
|
|
|
219
220
|
:param err_code: error code to pass to the console as exit code if :paramref:`.exit_on_err` is True.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ae_shell
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.15
|
|
4
4
|
Summary: ae namespace module portion shell: shell execution and environment helpers
|
|
5
5
|
Home-page: https://gitlab.com/ae-group/ae_shell
|
|
6
6
|
Author: AndiEcker
|
|
@@ -62,15 +62,15 @@ Dynamic: requires-dist
|
|
|
62
62
|
Dynamic: requires-python
|
|
63
63
|
Dynamic: summary
|
|
64
64
|
|
|
65
|
-
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.
|
|
66
|
-
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.
|
|
67
|
-
# shell 0.3.
|
|
65
|
+
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.104 -->
|
|
66
|
+
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.31 -->
|
|
67
|
+
# shell 0.3.15
|
|
68
68
|
|
|
69
69
|
[](
|
|
70
70
|
https://gitlab.com/ae-group/ae_shell)
|
|
71
71
|
[](
|
|
73
|
+
https://gitlab.com/ae-group/ae_shell/-/tree/release0.3.15)
|
|
74
74
|
[](
|
|
75
75
|
https://pypi.org/project/ae-shell/#history)
|
|
76
76
|
|
|
@@ -99,8 +99,8 @@ Dynamic: summary
|
|
|
99
99
|
https://pypi.org/project/ae-shell/#files)
|
|
100
100
|
|
|
101
101
|
|
|
102
|
-
## installation
|
|
103
102
|
|
|
103
|
+
## installation
|
|
104
104
|
|
|
105
105
|
execute the following command to install the
|
|
106
106
|
ae.shell module
|
|
@@ -121,10 +121,14 @@ following command in the root folder of this repository
|
|
|
121
121
|
pip install --editable .[dev]
|
|
122
122
|
```
|
|
123
123
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
this command installs this module portion project
|
|
125
|
+
along with the necessary tools to modify the source code,
|
|
126
|
+
run unit tests, and build documentation. to install only
|
|
127
|
+
the dependencies required for a specific task, replace
|
|
128
|
+
`dev` with one of the following:
|
|
129
|
+
|
|
130
|
+
* `tests`: for contributing to the unit test suite
|
|
131
|
+
* `docs`: for maintaining and building documentation
|
|
128
132
|
|
|
129
133
|
more detailed explanations on how to contribute to this project
|
|
130
134
|
[are available here](
|
|
@@ -133,7 +137,9 @@ https://gitlab.com/ae-group/ae_shell/-/blob/develop/CONTRIBUTING.rst)
|
|
|
133
137
|
|
|
134
138
|
## namespace portion documentation
|
|
135
139
|
|
|
136
|
-
|
|
140
|
+
the documentation of the source code of this portion is available at
|
|
137
141
|
[ReadTheDocs](
|
|
138
142
|
https://ae.readthedocs.io/en/latest/_autosummary/ae.shell.html
|
|
139
143
|
"ae_shell documentation").
|
|
144
|
+
|
|
145
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.project_tpls v0.3.
|
|
1
|
+
# THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.project_tpls v0.3.79
|
|
2
2
|
""" setup of ae namespace module portion shell: shell execution and environment helpers. """
|
|
3
3
|
import sys
|
|
4
4
|
# noinspection PyUnresolvedReferences
|
|
@@ -78,7 +78,7 @@ setup_kwargs = {
|
|
|
78
78
|
},
|
|
79
79
|
'python_requires': '>=3.12',
|
|
80
80
|
'url': 'https://gitlab.com/ae-group/ae_shell',
|
|
81
|
-
'version': '0.3.
|
|
81
|
+
'version': '0.3.15',
|
|
82
82
|
'zip_safe': True,
|
|
83
83
|
}
|
|
84
84
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|