ae-shell 0.3.13__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.13 → ae_shell-0.3.15}/LICENSE.md +1 -1
- {ae_shell-0.3.13/ae_shell.egg-info → ae_shell-0.3.15}/PKG-INFO +19 -12
- {ae_shell-0.3.13 → ae_shell-0.3.15}/README.md +17 -11
- {ae_shell-0.3.13 → ae_shell-0.3.15}/ae/shell.py +14 -12
- {ae_shell-0.3.13 → ae_shell-0.3.15/ae_shell.egg-info}/PKG-INFO +19 -12
- {ae_shell-0.3.13 → ae_shell-0.3.15}/ae_shell.egg-info/requires.txt +1 -0
- {ae_shell-0.3.13 → ae_shell-0.3.15}/pyproject.toml +1 -1
- {ae_shell-0.3.13 → ae_shell-0.3.15}/setup.py +3 -2
- {ae_shell-0.3.13 → ae_shell-0.3.15}/ae_shell.egg-info/SOURCES.txt +0 -0
- {ae_shell-0.3.13 → ae_shell-0.3.15}/ae_shell.egg-info/dependency_links.txt +0 -0
- {ae_shell-0.3.13 → ae_shell-0.3.15}/ae_shell.egg-info/top_level.txt +0 -0
- {ae_shell-0.3.13 → ae_shell-0.3.15}/ae_shell.egg-info/zip-safe +0 -0
- {ae_shell-0.3.13 → ae_shell-0.3.15}/setup.cfg +0 -0
- {ae_shell-0.3.13 → 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
|
|
@@ -23,6 +23,7 @@ Requires-Python: >=3.12
|
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
24
24
|
License-File: LICENSE.md
|
|
25
25
|
Requires-Dist: ae_base
|
|
26
|
+
Requires-Dist: ae_system
|
|
26
27
|
Requires-Dist: ae_core
|
|
27
28
|
Requires-Dist: ae_console
|
|
28
29
|
Provides-Extra: dev
|
|
@@ -61,15 +62,15 @@ Dynamic: requires-dist
|
|
|
61
62
|
Dynamic: requires-python
|
|
62
63
|
Dynamic: summary
|
|
63
64
|
|
|
64
|
-
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.
|
|
65
|
-
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.
|
|
66
|
-
# 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
|
|
67
68
|
|
|
68
69
|
[](
|
|
69
70
|
https://gitlab.com/ae-group/ae_shell)
|
|
70
71
|
[](
|
|
73
|
+
https://gitlab.com/ae-group/ae_shell/-/tree/release0.3.15)
|
|
73
74
|
[](
|
|
74
75
|
https://pypi.org/project/ae-shell/#history)
|
|
75
76
|
|
|
@@ -98,8 +99,8 @@ Dynamic: summary
|
|
|
98
99
|
https://pypi.org/project/ae-shell/#files)
|
|
99
100
|
|
|
100
101
|
|
|
101
|
-
## installation
|
|
102
102
|
|
|
103
|
+
## installation
|
|
103
104
|
|
|
104
105
|
execute the following command to install the
|
|
105
106
|
ae.shell module
|
|
@@ -120,10 +121,14 @@ following command in the root folder of this repository
|
|
|
120
121
|
pip install --editable .[dev]
|
|
121
122
|
```
|
|
122
123
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
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
|
|
127
132
|
|
|
128
133
|
more detailed explanations on how to contribute to this project
|
|
129
134
|
[are available here](
|
|
@@ -132,7 +137,9 @@ https://gitlab.com/ae-group/ae_shell/-/blob/develop/CONTRIBUTING.rst)
|
|
|
132
137
|
|
|
133
138
|
## namespace portion documentation
|
|
134
139
|
|
|
135
|
-
|
|
140
|
+
the documentation of the source code of this portion is available at
|
|
136
141
|
[ReadTheDocs](
|
|
137
142
|
https://ae.readthedocs.io/en/latest/_autosummary/ae.shell.html
|
|
138
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,22 +23,24 @@ 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
|
-
from ae.base import UNSET, dummy_function, env_str,
|
|
30
|
+
from ae.base import UNSET, dummy_function, env_str, norm_name # type: ignore
|
|
31
|
+
from ae.system import load_env_var_defaults # type: ignore
|
|
30
32
|
from ae.core import main_app_instance, AppBase # type: ignore
|
|
31
33
|
from ae.console import MAIN_SECTION_NAME, ConsoleApp # type: ignore
|
|
32
34
|
|
|
33
35
|
|
|
34
|
-
__version__ = '0.3.
|
|
36
|
+
__version__ = '0.3.15'
|
|
35
37
|
|
|
36
38
|
|
|
37
39
|
STDERR_BEG_MARKER = "vvv STDERR vvv" #: :paramref:`ae.shell.sh_exec.lines_output` begin stderr lines
|
|
38
40
|
STDERR_END_MARKER = "^^^ STDERR ^^^" #: end stderr lines in :paramref:`ae.shell.sh_exec.lines_output`
|
|
39
41
|
|
|
40
42
|
|
|
41
|
-
def debug_or_verbose(app_obj:
|
|
43
|
+
def debug_or_verbose(app_obj: ConsoleApp | None = None) -> bool:
|
|
42
44
|
""" determine if the current app runs in debug|verbose mode, while preventing early .get_option() call an app init.
|
|
43
45
|
|
|
44
46
|
:param app_obj: optional ConsoleApp instance (def=main_app_instance()).
|
|
@@ -85,7 +87,7 @@ def get_domain_user_var(variable_name: str, domain: str = "", user: str = "") ->
|
|
|
85
87
|
return value
|
|
86
88
|
|
|
87
89
|
|
|
88
|
-
def hint(command: str, action:
|
|
90
|
+
def hint(command: str, action: Callable | str, message_suffix: str = "") -> str:
|
|
89
91
|
""" return hint string in debug/verbose mode, to be appended onto a shell/console output.
|
|
90
92
|
|
|
91
93
|
:param command: shell command.
|
|
@@ -122,7 +124,7 @@ def mask_token(text: str) -> str: ...
|
|
|
122
124
|
def mask_token(text: list[str]) -> list[str]: ...
|
|
123
125
|
|
|
124
126
|
|
|
125
|
-
def mask_token(text:
|
|
127
|
+
def mask_token(text: str | list[str]) -> str | list[str]:
|
|
126
128
|
""" hide most parts of any Codeberg/GitHub/GitHub URL tokens found in the specified text/-lines.
|
|
127
129
|
|
|
128
130
|
:param text: text, specified either as str object or as a list of str objects (lines),
|
|
@@ -152,8 +154,8 @@ def mask_token(text: Union[str, list[str]]) -> Union[str, list[str]]:
|
|
|
152
154
|
|
|
153
155
|
# pylint: disable-next=too-many-arguments,too-many-positional-arguments
|
|
154
156
|
def sh_exec(command_line: str, extra_args: Iterable[str] = (), console_input: str = "",
|
|
155
|
-
lines_output:
|
|
156
|
-
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:
|
|
157
159
|
""" execute command in the current working directory of the OS console/shell.
|
|
158
160
|
|
|
159
161
|
:param command_line: command line string to execute on the console/shell. could contain command line args
|
|
@@ -180,7 +182,7 @@ def sh_exec(command_line: str, extra_args: Iterable[str] = (), console_input: st
|
|
|
180
182
|
debug_out = app_obj.dpo if app_obj else dummy_function if app_obj is UNSET else print
|
|
181
183
|
debug_out(f" . executing at {os.getcwd()}: {mask_token(args)}")
|
|
182
184
|
|
|
183
|
-
result:
|
|
185
|
+
result: subprocess.CompletedProcess | subprocess.CalledProcessError # having: stdout/stderr/returncode
|
|
184
186
|
try:
|
|
185
187
|
result = subprocess.run(args,
|
|
186
188
|
stdout=subprocess.PIPE if ret_out else None,
|
|
@@ -210,9 +212,9 @@ def sh_exec(command_line: str, extra_args: Iterable[str] = (), console_input: st
|
|
|
210
212
|
|
|
211
213
|
# pylint: disable-next=too-many-arguments,too-many-positional-arguments
|
|
212
214
|
def sh_exit_if_exec_err(err_code: int, command_line: str,
|
|
213
|
-
extra_args: Iterable[str] = (), lines_output:
|
|
214
|
-
exit_on_err: bool = True, exit_msg: str = "", app_obj:
|
|
215
|
-
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:
|
|
216
218
|
""" execute command in the current working directory of the OS console/shell, dump error, and exit app if needed.
|
|
217
219
|
|
|
218
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
|
|
@@ -23,6 +23,7 @@ Requires-Python: >=3.12
|
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
24
24
|
License-File: LICENSE.md
|
|
25
25
|
Requires-Dist: ae_base
|
|
26
|
+
Requires-Dist: ae_system
|
|
26
27
|
Requires-Dist: ae_core
|
|
27
28
|
Requires-Dist: ae_console
|
|
28
29
|
Provides-Extra: dev
|
|
@@ -61,15 +62,15 @@ Dynamic: requires-dist
|
|
|
61
62
|
Dynamic: requires-python
|
|
62
63
|
Dynamic: summary
|
|
63
64
|
|
|
64
|
-
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae v0.3.
|
|
65
|
-
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.namespace_root_tpls v0.3.
|
|
66
|
-
# 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
|
|
67
68
|
|
|
68
69
|
[](
|
|
69
70
|
https://gitlab.com/ae-group/ae_shell)
|
|
70
71
|
[](
|
|
73
|
+
https://gitlab.com/ae-group/ae_shell/-/tree/release0.3.15)
|
|
73
74
|
[](
|
|
74
75
|
https://pypi.org/project/ae-shell/#history)
|
|
75
76
|
|
|
@@ -98,8 +99,8 @@ Dynamic: summary
|
|
|
98
99
|
https://pypi.org/project/ae-shell/#files)
|
|
99
100
|
|
|
100
101
|
|
|
101
|
-
## installation
|
|
102
102
|
|
|
103
|
+
## installation
|
|
103
104
|
|
|
104
105
|
execute the following command to install the
|
|
105
106
|
ae.shell module
|
|
@@ -120,10 +121,14 @@ following command in the root folder of this repository
|
|
|
120
121
|
pip install --editable .[dev]
|
|
121
122
|
```
|
|
122
123
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
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
|
|
127
132
|
|
|
128
133
|
more detailed explanations on how to contribute to this project
|
|
129
134
|
[are available here](
|
|
@@ -132,7 +137,9 @@ https://gitlab.com/ae-group/ae_shell/-/blob/develop/CONTRIBUTING.rst)
|
|
|
132
137
|
|
|
133
138
|
## namespace portion documentation
|
|
134
139
|
|
|
135
|
-
|
|
140
|
+
the documentation of the source code of this portion is available at
|
|
136
141
|
[ReadTheDocs](
|
|
137
142
|
https://ae.readthedocs.io/en/latest/_autosummary/ae.shell.html
|
|
138
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
|
|
@@ -50,6 +50,7 @@ setup_kwargs = {
|
|
|
50
50
|
},
|
|
51
51
|
'install_requires': [
|
|
52
52
|
'ae_base',
|
|
53
|
+
'ae_system',
|
|
53
54
|
'ae_core',
|
|
54
55
|
'ae_console',
|
|
55
56
|
],
|
|
@@ -77,7 +78,7 @@ setup_kwargs = {
|
|
|
77
78
|
},
|
|
78
79
|
'python_requires': '>=3.12',
|
|
79
80
|
'url': 'https://gitlab.com/ae-group/ae_shell',
|
|
80
|
-
'version': '0.3.
|
|
81
|
+
'version': '0.3.15',
|
|
81
82
|
'zip_safe': True,
|
|
82
83
|
}
|
|
83
84
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|