pyallel 1.2.1__tar.gz → 1.2.3__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.1 → pyallel-1.2.3}/PKG-INFO +1 -4
- {pyallel-1.2.1 → pyallel-1.2.3}/README.md +0 -3
- {pyallel-1.2.1 → pyallel-1.2.3}/pyproject.toml +1 -1
- {pyallel-1.2.1 → pyallel-1.2.3}/src/pyallel/process_group.py +38 -17
- {pyallel-1.2.1 → pyallel-1.2.3}/LICENSE +0 -0
- {pyallel-1.2.1 → pyallel-1.2.3}/src/pyallel/__init__.py +0 -0
- {pyallel-1.2.1 → pyallel-1.2.3}/src/pyallel/colours.py +0 -0
- {pyallel-1.2.1 → pyallel-1.2.3}/src/pyallel/constants.py +0 -0
- {pyallel-1.2.1 → pyallel-1.2.3}/src/pyallel/errors.py +0 -0
- {pyallel-1.2.1 → pyallel-1.2.3}/src/pyallel/main.py +0 -0
- {pyallel-1.2.1 → pyallel-1.2.3}/src/pyallel/parser.py +0 -0
- {pyallel-1.2.1 → pyallel-1.2.3}/src/pyallel/process.py +0 -0
- {pyallel-1.2.1 → pyallel-1.2.3}/src/pyallel/process_group_manager.py +0 -0
- {pyallel-1.2.1 → pyallel-1.2.3}/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.3
|
|
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
|
|
@@ -141,9 +141,6 @@ python -m venv .venv && \
|
|
|
141
141
|
- [x] Add support to have commands depend on other commands (some commands must complete
|
|
142
142
|
before a given command can start)
|
|
143
143
|
- [ ] Add a debug mode that logs debug information to a log file
|
|
144
|
-
- [ ] Fix wrapping of long commands in the command status line
|
|
145
|
-
- [ ] Fix wrapping of very long lines in command output that pushes other commands off the
|
|
146
|
-
screen
|
|
147
144
|
- [ ] Add support to state how many lines a command can use for it's output in interactive mode
|
|
148
145
|
- [ ] Maybe add support to allow the user to provide stdin for commands that request it
|
|
149
146
|
(such as a REPL)
|
|
@@ -119,9 +119,6 @@ python -m venv .venv && \
|
|
|
119
119
|
- [x] Add support to have commands depend on other commands (some commands must complete
|
|
120
120
|
before a given command can start)
|
|
121
121
|
- [ ] Add a debug mode that logs debug information to a log file
|
|
122
|
-
- [ ] Fix wrapping of long commands in the command status line
|
|
123
|
-
- [ ] Fix wrapping of very long lines in command output that pushes other commands off the
|
|
124
|
-
screen
|
|
125
122
|
- [ ] Add support to state how many lines a command can use for it's output in interactive mode
|
|
126
123
|
- [ ] Maybe add support to allow the user to provide stdin for commands that request it
|
|
127
124
|
(such as a REPL)
|
|
@@ -16,7 +16,13 @@ def get_num_lines(output: str, columns: int | None = None) -> int:
|
|
|
16
16
|
for line in output.splitlines():
|
|
17
17
|
line = constants.ANSI_ESCAPE.sub("", line)
|
|
18
18
|
length = len(line)
|
|
19
|
-
|
|
19
|
+
line_lines = 1
|
|
20
|
+
if length > columns:
|
|
21
|
+
line_lines = length // columns
|
|
22
|
+
remainder = length % columns
|
|
23
|
+
if remainder:
|
|
24
|
+
line_lines += 1
|
|
25
|
+
lines += 1 * line_lines
|
|
20
26
|
return lines
|
|
21
27
|
|
|
22
28
|
|
|
@@ -260,40 +266,55 @@ class ProcessGroup:
|
|
|
260
266
|
|
|
261
267
|
output = ""
|
|
262
268
|
for i, process in enumerate(self.processes, start=1):
|
|
269
|
+
process_output = ""
|
|
263
270
|
if process.poll() is not None:
|
|
264
271
|
self.completed_processes.add(process.id)
|
|
265
272
|
if process.return_code() != 0:
|
|
266
273
|
self.passed = False
|
|
267
|
-
|
|
274
|
+
process_output += self._get_command_status(
|
|
268
275
|
process,
|
|
269
276
|
passed=process.return_code() == 0,
|
|
270
277
|
timer=self.timer,
|
|
271
278
|
)
|
|
272
|
-
|
|
279
|
+
process_output += "\n"
|
|
273
280
|
else:
|
|
274
|
-
|
|
281
|
+
process_output += self._get_command_status(
|
|
275
282
|
process,
|
|
276
283
|
icon=constants.ICONS[self.icon],
|
|
277
284
|
timer=self.timer,
|
|
278
285
|
)
|
|
279
|
-
|
|
286
|
+
process_output += "\n"
|
|
280
287
|
|
|
281
|
-
|
|
288
|
+
command_lines = get_num_lines(process_output)
|
|
289
|
+
p_output = process.read().decode()
|
|
282
290
|
if not self.output[process.id]:
|
|
283
291
|
self.output[process.id].append("")
|
|
284
|
-
self.output[process.id][0] +=
|
|
285
|
-
|
|
286
|
-
|
|
292
|
+
self.output[process.id][0] += p_output
|
|
293
|
+
p_output = self.output[process.id][0]
|
|
294
|
+
p_output_lines = 0
|
|
295
|
+
if p_output:
|
|
287
296
|
if not all:
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
297
|
+
p_output_lines = p_output.splitlines()[-self.process_lines[i - 1] :]
|
|
298
|
+
p_output = ""
|
|
299
|
+
for line in p_output_lines:
|
|
300
|
+
if len(line) + 3 > constants.COLUMNS():
|
|
301
|
+
p_output += f"{''.join(line[:constants.COLUMNS()-3])}\n"
|
|
302
|
+
else:
|
|
303
|
+
p_output += line + "\n"
|
|
304
|
+
p_output = self._prefix(p_output)
|
|
305
|
+
if p_output and p_output[-1] != "\n":
|
|
306
|
+
p_output += "\n"
|
|
295
307
|
if i != num_processes:
|
|
296
|
-
|
|
308
|
+
p_output += "\n"
|
|
309
|
+
p_output_lines = get_num_lines(p_output)
|
|
310
|
+
|
|
311
|
+
if not all and (command_lines + p_output_lines) > self.process_lines[i - 1]:
|
|
312
|
+
truncate = (command_lines + p_output_lines) - self.process_lines[i - 1]
|
|
313
|
+
p_output = "\n".join(p_output.splitlines()[truncate:])
|
|
314
|
+
p_output += "\n"
|
|
315
|
+
|
|
316
|
+
process_output += p_output
|
|
317
|
+
output += process_output
|
|
297
318
|
|
|
298
319
|
if self.interrupt_count == 0:
|
|
299
320
|
return output
|
|
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
|