libPyshell 0.4.1__tar.gz → 0.5.0__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.
- {libpyshell-0.4.1/libPyshell.egg-info → libpyshell-0.5.0}/PKG-INFO +12 -2
- {libpyshell-0.4.1 → libpyshell-0.5.0}/README.md +3 -0
- {libpyshell-0.4.1 → libpyshell-0.5.0/libPyshell.egg-info}/PKG-INFO +12 -2
- {libpyshell-0.4.1 → libpyshell-0.5.0}/setup.py +1 -1
- {libpyshell-0.4.1 → libpyshell-0.5.0}/src/__init__.py +18 -7
- {libpyshell-0.4.1 → libpyshell-0.5.0}/LICENSE +0 -0
- {libpyshell-0.4.1 → libpyshell-0.5.0}/MANIFEST.in +0 -0
- {libpyshell-0.4.1 → libpyshell-0.5.0}/libPyshell.egg-info/SOURCES.txt +0 -0
- {libpyshell-0.4.1 → libpyshell-0.5.0}/libPyshell.egg-info/dependency_links.txt +0 -0
- {libpyshell-0.4.1 → libpyshell-0.5.0}/libPyshell.egg-info/top_level.txt +0 -0
- {libpyshell-0.4.1 → libpyshell-0.5.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: libPyshell
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Summary: Support for writing shell scripts in Python
|
|
5
5
|
Home-page: https://github.com/skogsbaer/libPyshell
|
|
6
6
|
Author: Stefan Wehr
|
|
@@ -8,6 +8,13 @@ Author-email: stefan.wehr@gmail.com
|
|
|
8
8
|
Requires-Python: >=3.9
|
|
9
9
|
Description-Content-Type: text/markdown
|
|
10
10
|
License-File: LICENSE
|
|
11
|
+
Dynamic: author
|
|
12
|
+
Dynamic: author-email
|
|
13
|
+
Dynamic: description
|
|
14
|
+
Dynamic: description-content-type
|
|
15
|
+
Dynamic: home-page
|
|
16
|
+
Dynamic: requires-python
|
|
17
|
+
Dynamic: summary
|
|
11
18
|
|
|
12
19
|
# Pyshell
|
|
13
20
|
|
|
@@ -37,6 +44,9 @@ magicFiles = run(['grep', 'magic'] + files, captureStdout=splitLines, onError='i
|
|
|
37
44
|
|
|
38
45
|
## Changelog
|
|
39
46
|
|
|
47
|
+
* 0.5.0 (2025-03-11)
|
|
48
|
+
* support of timeouts for run
|
|
49
|
+
|
|
40
50
|
* 0.4.1 (2024-09-12)
|
|
41
51
|
* fix capture handling
|
|
42
52
|
* add failOnError option to rm commands
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: libPyshell
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Summary: Support for writing shell scripts in Python
|
|
5
5
|
Home-page: https://github.com/skogsbaer/libPyshell
|
|
6
6
|
Author: Stefan Wehr
|
|
@@ -8,6 +8,13 @@ Author-email: stefan.wehr@gmail.com
|
|
|
8
8
|
Requires-Python: >=3.9
|
|
9
9
|
Description-Content-Type: text/markdown
|
|
10
10
|
License-File: LICENSE
|
|
11
|
+
Dynamic: author
|
|
12
|
+
Dynamic: author-email
|
|
13
|
+
Dynamic: description
|
|
14
|
+
Dynamic: description-content-type
|
|
15
|
+
Dynamic: home-page
|
|
16
|
+
Dynamic: requires-python
|
|
17
|
+
Dynamic: summary
|
|
11
18
|
|
|
12
19
|
# Pyshell
|
|
13
20
|
|
|
@@ -37,6 +44,9 @@ magicFiles = run(['grep', 'magic'] + files, captureStdout=splitLines, onError='i
|
|
|
37
44
|
|
|
38
45
|
## Changelog
|
|
39
46
|
|
|
47
|
+
* 0.5.0 (2025-03-11)
|
|
48
|
+
* support of timeouts for run
|
|
49
|
+
|
|
40
50
|
* 0.4.1 (2024-09-12)
|
|
41
51
|
* fix capture handling
|
|
42
52
|
* add failOnError option to rm commands
|
|
@@ -227,7 +227,8 @@ def run(cmd: Union[list[str], str],
|
|
|
227
227
|
decodeErrors: str='replace',
|
|
228
228
|
decodeErrorsStdout: Optional[str]=None,
|
|
229
229
|
decodeErrorsStderr: Optional[str]=None,
|
|
230
|
-
encodeErrorsStdin: Optional[str]=None
|
|
230
|
+
encodeErrorsStdin: Optional[str]=None,
|
|
231
|
+
timeout: Optional[int]=None
|
|
231
232
|
) -> RunResult:
|
|
232
233
|
"""Runs the given command.
|
|
233
234
|
|
|
@@ -258,7 +259,8 @@ def run(cmd: Union[list[str], str],
|
|
|
258
259
|
* `decodeErrors`: how to handle decoding/encoding errors on stdout and stderr and stdin.
|
|
259
260
|
* `decodeErrorsStdout` and `decodeErrorsStderr` and `encodeErrorsStdin`: overwrite the value
|
|
260
261
|
of decodeErrors for stdout or stderr or stdin
|
|
261
|
-
|
|
262
|
+
* `timeout`: an optional timeout value in seconds. If a timeout occurs, the exit code will
|
|
263
|
+
be 124 (as for the unix timeout command)
|
|
262
264
|
Returns:
|
|
263
265
|
a `RunResult` value, given access to the captured stdout of the child process (if it was
|
|
264
266
|
captured at all) and to the exit code of the child process.
|
|
@@ -315,11 +317,20 @@ def run(cmd: Union[list[str], str],
|
|
|
315
317
|
if _PYSHELL_DEBUG:
|
|
316
318
|
_debug(f'subprocess.run({cmd}, shell={shell}, input={input}, stdout={stdout}, ' \
|
|
317
319
|
f'stderr={stderr}, cwd={cwd}, env={runEnv})')
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
320
|
+
try:
|
|
321
|
+
res = subprocess.run(cmd, shell=shell, input=input, stdout=stdout, stderr=stderr, cwd=cwd,
|
|
322
|
+
env=runEnv, timeout=timeout)
|
|
323
|
+
out = res.stdout
|
|
324
|
+
err = res.stderr
|
|
325
|
+
exitcode = res.returncode
|
|
326
|
+
hadTimeout = False
|
|
327
|
+
except subprocess.TimeoutExpired as e:
|
|
328
|
+
out = e.stdout
|
|
329
|
+
err = e.stderr
|
|
330
|
+
exitcode = 124
|
|
331
|
+
hadTimeout = True
|
|
332
|
+
stdoutData = _massageOutput(out, encoding, decodeErrorsStdout or decodeErrors, captureStdout)
|
|
333
|
+
stderrData = _massageOutput(err, encoding, decodeErrorsStderr or decodeErrors, captureStderr)
|
|
323
334
|
if onError == 'raise' and exitcode != 0:
|
|
324
335
|
err = RunError(cmd, exitcode, stdoutData, stderrData)
|
|
325
336
|
raise err
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|