multiCMD 1.21__tar.gz → 1.22__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: multiCMD
3
- Version: 1.21
3
+ Version: 1.22
4
4
  Summary: Run commands simultaneously
5
5
  Home-page: https://github.com/yufei-pan/multiCMD
6
6
  Author: Yufei Pan
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: multiCMD
3
- Version: 1.21
3
+ Version: 1.22
4
4
  Summary: Run commands simultaneously
5
5
  Home-page: https://github.com/yufei-pan/multiCMD
6
6
  Author: Yufei Pan
@@ -18,7 +18,7 @@ import re
18
18
  import itertools
19
19
  import signal
20
20
 
21
- version = '1.21'
21
+ version = '1.22'
22
22
  __version__ = version
23
23
 
24
24
  __running_threads = []
@@ -239,19 +239,21 @@ def __run_command(task,sem, timeout=60, quiet=False,dry_run=False,with_stdErr=Fa
239
239
  task.returncode = 137
240
240
  else:
241
241
  task.returncode = -1
242
- if not quiet:
243
- print(pre+'\n'+ '-'*100+post)
244
- print(pre+f'Process exited with return code {task.returncode}'+post)
245
242
  # if file not found
246
243
  except FileNotFoundError as e:
247
- task.stdout.append(f'Command / path not found: {task.command[0]}')
244
+ print(f'Command / path not found: {task.command[0]}',file=sys.stderr,flush=True)
248
245
  task.stderr.append(str(e))
249
246
  task.returncode = 127
250
247
  except Exception as e:
251
248
  import traceback
249
+ print(f'Error running command: {task.command}',file=sys.stderr,flush=True)
250
+ print(str(e).split('\n'))
252
251
  task.stderr.extend(str(e).split('\n'))
253
252
  task.stderr.extend(traceback.format_exc().split('\n'))
254
253
  task.returncode = -1
254
+ if not quiet:
255
+ print(pre+'\n'+ '-'*100+post)
256
+ print(pre+f'Process exited with return code {task.returncode}'+post)
255
257
  if with_stdErr:
256
258
  return task.stdout + task.stderr
257
259
  else:
@@ -525,7 +527,7 @@ def main():
525
527
  parser.add_argument('-q','--quiet', action='store_true',help='quiet mode')
526
528
  parser.add_argument('-V','--version', action='version', version=f'%(prog)s {version} by pan@zopyr.us')
527
529
  args = parser.parse_args()
528
- run_commands(args.commands, args.timeout, args.max_threads, args.quiet,parse = args.parse)
530
+ run_commands(args.commands, args.timeout, args.max_threads, args.quiet,parse = args.parse, with_stdErr=True)
529
531
 
530
532
  if __name__ == '__main__':
531
533
  main()
File without changes
File without changes
File without changes