pyallel 1.2.4__tar.gz → 1.2.6__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.
- {pyallel-1.2.4 → pyallel-1.2.6}/PKG-INFO +3 -1
- {pyallel-1.2.4 → pyallel-1.2.6}/pyproject.toml +2 -2
- {pyallel-1.2.4 → pyallel-1.2.6}/src/pyallel/constants.py +3 -3
- {pyallel-1.2.4 → pyallel-1.2.6}/src/pyallel/process_group.py +12 -6
- {pyallel-1.2.4 → pyallel-1.2.6}/LICENSE +0 -0
- {pyallel-1.2.4 → pyallel-1.2.6}/README.md +0 -0
- {pyallel-1.2.4 → pyallel-1.2.6}/src/pyallel/__init__.py +0 -0
- {pyallel-1.2.4 → pyallel-1.2.6}/src/pyallel/colours.py +0 -0
- {pyallel-1.2.4 → pyallel-1.2.6}/src/pyallel/errors.py +0 -0
- {pyallel-1.2.4 → pyallel-1.2.6}/src/pyallel/main.py +0 -0
- {pyallel-1.2.4 → pyallel-1.2.6}/src/pyallel/parser.py +0 -0
- {pyallel-1.2.4 → pyallel-1.2.6}/src/pyallel/process.py +0 -0
- {pyallel-1.2.4 → pyallel-1.2.6}/src/pyallel/process_group_manager.py +0 -0
- {pyallel-1.2.4 → pyallel-1.2.6}/src/pyallel/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pyallel
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.6
|
|
4
4
|
Summary: Run and handle the output of multiple executables in pyallel (as in parallel)
|
|
5
5
|
Home-page: https://github.com/Danthewaann/pyallel
|
|
6
6
|
License: MIT
|
|
@@ -17,6 +17,8 @@ Classifier: Programming Language :: Python :: 3.8
|
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.9
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.10
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
22
|
Project-URL: Repository, https://github.com/Danthewaann/pyallel
|
|
21
23
|
Description-Content-Type: text/markdown
|
|
22
24
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "pyallel"
|
|
3
|
-
version = "1.2.
|
|
3
|
+
version = "1.2.6"
|
|
4
4
|
description = "Run and handle the output of multiple executables in pyallel (as in parallel)"
|
|
5
5
|
authors = ["Daniel Black <danielcrblack@gmail.com>"]
|
|
6
6
|
license = "MIT"
|
|
@@ -25,7 +25,7 @@ python = ">=3.8,<3.14"
|
|
|
25
25
|
[tool.poetry.group.dev.dependencies]
|
|
26
26
|
pytest = "^7.4.3"
|
|
27
27
|
mypy = "^1.7.0"
|
|
28
|
-
pyinstaller = "6.
|
|
28
|
+
pyinstaller = "6.11.0"
|
|
29
29
|
|
|
30
30
|
[tool.mypy]
|
|
31
31
|
strict = true
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import os
|
|
2
1
|
import re
|
|
2
|
+
import shutil
|
|
3
3
|
import sys
|
|
4
4
|
|
|
5
5
|
IN_TTY = sys.stdout.isatty()
|
|
@@ -10,10 +10,10 @@ ANSI_ESCAPE = re.compile(r"(\x9B|\x1B\[|\x1B\()[0-?]*[ -\/]*[@-~]")
|
|
|
10
10
|
if IN_TTY:
|
|
11
11
|
|
|
12
12
|
def COLUMNS() -> int:
|
|
13
|
-
return
|
|
13
|
+
return shutil.get_terminal_size().columns
|
|
14
14
|
|
|
15
15
|
def LINES() -> int:
|
|
16
|
-
return
|
|
16
|
+
return shutil.get_terminal_size().lines
|
|
17
17
|
|
|
18
18
|
else:
|
|
19
19
|
|
|
@@ -291,11 +291,12 @@ class ProcessGroup:
|
|
|
291
291
|
self.output[process.id].append("")
|
|
292
292
|
self.output[process.id][0] += p_output
|
|
293
293
|
p_output = self.output[process.id][0]
|
|
294
|
-
|
|
294
|
+
p_output_lines_num = 0
|
|
295
295
|
if p_output:
|
|
296
296
|
if not all:
|
|
297
|
+
p_output_lines = p_output.splitlines()[-self.process_lines[i - 1] :]
|
|
297
298
|
p_output = ""
|
|
298
|
-
for line in
|
|
299
|
+
for line in p_output_lines:
|
|
299
300
|
if len(line) + 3 > constants.COLUMNS():
|
|
300
301
|
p_output += f"{''.join(line[:constants.COLUMNS()-3])}\n"
|
|
301
302
|
else:
|
|
@@ -305,10 +306,15 @@ class ProcessGroup:
|
|
|
305
306
|
p_output += "\n"
|
|
306
307
|
if i != num_processes:
|
|
307
308
|
p_output += "\n"
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
if
|
|
311
|
-
|
|
309
|
+
p_output_lines_num = get_num_lines(p_output)
|
|
310
|
+
|
|
311
|
+
if (
|
|
312
|
+
not all
|
|
313
|
+
and (command_lines + p_output_lines_num) > self.process_lines[i - 1]
|
|
314
|
+
):
|
|
315
|
+
truncate = (command_lines + p_output_lines_num) - self.process_lines[
|
|
316
|
+
i - 1
|
|
317
|
+
]
|
|
312
318
|
p_output = "\n".join(p_output.splitlines()[truncate:])
|
|
313
319
|
p_output += "\n"
|
|
314
320
|
|
|
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
|