multiCMD 1.22__tar.gz → 1.23__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.
- {multicmd-1.22 → multicmd-1.23}/PKG-INFO +1 -1
- {multicmd-1.22 → multicmd-1.23}/multiCMD.egg-info/PKG-INFO +1 -1
- {multicmd-1.22 → multicmd-1.23}/multiCMD.py +8 -2
- {multicmd-1.22 → multicmd-1.23}/README.md +0 -0
- {multicmd-1.22 → multicmd-1.23}/multiCMD.egg-info/SOURCES.txt +0 -0
- {multicmd-1.22 → multicmd-1.23}/multiCMD.egg-info/dependency_links.txt +0 -0
- {multicmd-1.22 → multicmd-1.23}/multiCMD.egg-info/entry_points.txt +0 -0
- {multicmd-1.22 → multicmd-1.23}/multiCMD.egg-info/requires.txt +0 -0
- {multicmd-1.22 → multicmd-1.23}/multiCMD.egg-info/top_level.txt +0 -0
- {multicmd-1.22 → multicmd-1.23}/setup.cfg +0 -0
- {multicmd-1.22 → multicmd-1.23}/setup.py +0 -0
@@ -18,7 +18,7 @@ import re
|
|
18
18
|
import itertools
|
19
19
|
import signal
|
20
20
|
|
21
|
-
version = '1.
|
21
|
+
version = '1.23'
|
22
22
|
__version__ = version
|
23
23
|
|
24
24
|
__running_threads = []
|
@@ -28,6 +28,7 @@ class Task:
|
|
28
28
|
self.returncode = None
|
29
29
|
self.stdout = []
|
30
30
|
self.stderr = []
|
31
|
+
self.thread = None
|
31
32
|
self.stop = False
|
32
33
|
def __iter__(self):
|
33
34
|
return zip(['command', 'returncode', 'stdout', 'stderr'], [self.command, self.returncode, self.stdout, self.stderr])
|
@@ -35,6 +36,10 @@ class Task:
|
|
35
36
|
return f'Task(command={self.command}, returncode={self.returncode}, stdout={self.stdout}, stderr={self.stderr}, stop={self.stop})'
|
36
37
|
def __str__(self):
|
37
38
|
return str(dict(self))
|
39
|
+
def is_alive(self):
|
40
|
+
if self.thread is not None:
|
41
|
+
return self.thread.is_alive()
|
42
|
+
return False
|
38
43
|
|
39
44
|
def _expand_ranges(inStr):
|
40
45
|
'''
|
@@ -350,7 +355,8 @@ def run_commands(commands, timeout=0,max_threads=1,quiet=False,dry_run=False,wit
|
|
350
355
|
if max_threads > 1 or not wait_for_return:
|
351
356
|
sem = threading.Semaphore(max_threads) # Limit concurrent sessions
|
352
357
|
threads = [threading.Thread(target=__run_command, args=(task,sem,timeout,quiet,dry_run,...),daemon=True) for task in tasks]
|
353
|
-
for thread in threads:
|
358
|
+
for thread,task in zip(threads,tasks):
|
359
|
+
task.thread = thread
|
354
360
|
thread.start()
|
355
361
|
if wait_for_return:
|
356
362
|
for thread in threads:
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|