multiSSH3 5.95__py3-none-any.whl → 5.96__py3-none-any.whl

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.

Potentially problematic release.


This version of multiSSH3 might be problematic. Click here for more details.

multiSSH3.py CHANGED
@@ -84,7 +84,7 @@ except Exception:
84
84
  print('Warning: functools.lru_cache is not available, multiSSH3 will run slower without cache.',file=sys.stderr)
85
85
  def cache_decorator(func):
86
86
  return func
87
- version = '5.95'
87
+ version = '5.96'
88
88
  VERSION = version
89
89
  __version__ = version
90
90
  COMMIT_DATE = '2025-10-21'
@@ -2892,12 +2892,13 @@ def mergeOutput(merging_hostnames,outputs_by_hostname,output,diff_display_thresh
2892
2892
  def mergeOutputs(outputs_by_hostname, merge_groups, remaining_hostnames, diff_display_threshold, line_length):
2893
2893
  output = []
2894
2894
  output.append(('┌'+'─'*(line_length-2) + '┐'))
2895
+ hostnameWrapper = textwrap.TextWrapper(width=line_length - 1, tabsize=4, replace_whitespace=False, drop_whitespace=False, break_on_hyphens=False,initial_indent='├─ ', subsequent_indent='│- ')
2896
+ hostnameWrapper.wordsep_simple_re = re.compile(r'([,]+)')
2895
2897
  for merging_hostnames in merge_groups:
2896
2898
  mergeOutput(merging_hostnames, outputs_by_hostname, output, diff_display_threshold,line_length)
2897
2899
  output.append('\033[0m├'+'─'*(line_length-2) + '┤')
2898
2900
  for hostname in remaining_hostnames:
2899
- hostnameLines = textwrap.wrap(hostname, width=line_length-1, tabsize=4, replace_whitespace=False, drop_whitespace=False,
2900
- initial_indent='├─ ', subsequent_indent='│- ')
2901
+ hostnameLines = hostnameWrapper.wrap(','.join(compact_hostnames([hostname])))
2901
2902
  output.extend(line.ljust(line_length - 1) + '│' for line in hostnameLines)
2902
2903
  output.extend(line.ljust(line_length - 1) + '│' for line in outputs_by_hostname[hostname])
2903
2904
  output.append('\033[0m├'+'─'*(line_length-2) + '┤')
@@ -2948,7 +2949,7 @@ def get_host_raw_output(hosts, terminal_width):
2948
2949
  lineBag.add((prevLine,1))
2949
2950
  lineBag.add((1,host.stdout[0]))
2950
2951
  if len(host.stdout) > 1:
2951
- lineBag.update(itertools.pairwise(host.stdout))
2952
+ lineBag.update(zip(host.stdout, host.stdout[1:]))
2952
2953
  lineBag.update(host.stdout)
2953
2954
  prevLine = host.stdout[-1]
2954
2955
  if host.stderr:
@@ -2970,7 +2971,7 @@ def get_host_raw_output(hosts, terminal_width):
2970
2971
  lineBag.add((2,host.stderr[0]))
2971
2972
  lineBag.update(host.stderr)
2972
2973
  if len(host.stderr) > 1:
2973
- lineBag.update(itertools.pairwise(host.stderr))
2974
+ lineBag.update(zip(host.stderr, host.stderr[1:]))
2974
2975
  prevLine = host.stderr[-1]
2975
2976
  hostPrintOut.append(f"│░ RETURN CODE: {host.returncode}")
2976
2977
  lineBag.add((prevLine,f"{host.returncode}"))
@@ -3757,7 +3758,7 @@ def get_parser():
3757
3758
  parser.add_argument('-ea','--extraargs',type=str,help=f'Extra arguments to pass to the ssh / rsync / scp command. Put in one string for multiple arguments.Use "=" ! Ex. -ea="--delete" (default: {DEFAULT_EXTRA_ARGS})',default=DEFAULT_EXTRA_ARGS)
3758
3759
  parser.add_argument("-11",'--oneonone', action='store_true', help=f"Run one corresponding command on each host. (default: {DEFAULT_ONE_ON_ONE})", default=DEFAULT_ONE_ON_ONE)
3759
3760
  parser.add_argument("-f","--file", action='append', help="The file to be copied to the hosts. Use -f multiple times to copy multiple files")
3760
- parser.add_argument('-s','-fs','--file_sync', action='store_true', help=f'Operate in file sync mode, sync path in <COMMANDS> from this machine to <HOSTS>. Treat --file <FILE> and <COMMANDS> both as source and source and destination will be the same in this mode. Infer destination from source path. (default: {DEFAULT_FILE_SYNC})', default=DEFAULT_FILE_SYNC)
3761
+ parser.add_argument('-s','-fs','--file_sync',nargs='?', action='append', help=f'Operate in file sync mode, sync path in <COMMANDS> from this machine to <HOSTS>. Treat --file <FILE> and <COMMANDS> both as source and source and destination will be the same in this mode. Infer destination from source path. (default: {DEFAULT_FILE_SYNC})',const=True, default=[DEFAULT_FILE_SYNC])
3761
3762
  parser.add_argument('-W','--scp', action='store_true', help=f'Use scp for copying files instead of rsync. Need to use this on windows. (default: {DEFAULT_SCP})', default=DEFAULT_SCP)
3762
3763
  parser.add_argument('-G','-gm','--gather_mode', action='store_true', help='Gather files from the hosts instead of sending files to the hosts. Will send remote files specified in <FILE> to local path specified in <COMMANDS> (default: False)', default=False)
3763
3764
  #parser.add_argument("-d",'-c',"--destination", type=str, help="The destination of the files. Same as specify with commands. Added for compatibility. Use #HOST# or #HOSTNAME# to replace the host name in the destination")
@@ -3828,7 +3829,18 @@ def process_args(args = None):
3828
3829
  args.no_history = True
3829
3830
  args.greppable = True
3830
3831
  args.error_only = True
3831
-
3832
+
3833
+ if args.file_sync:
3834
+ for path in args.file_sync:
3835
+ if path and isinstance(path, str):
3836
+ if args.file:
3837
+ if path not in args.file:
3838
+ args.file.append(path)
3839
+ else:
3840
+ args.file = [path]
3841
+ args.file_sync = any(args.file_sync)
3842
+ else:
3843
+ args.file_sync = False
3832
3844
  if args.unavailable_host_expiry <= 0:
3833
3845
  eprint(f"Warning: The unavailable host expiry time {args.unavailable_host_expiry} is less than 0, setting it to 10 seconds.")
3834
3846
  args.unavailable_host_expiry = 10
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: multiSSH3
3
- Version: 5.95
3
+ Version: 5.96
4
4
  Summary: Run commands on multiple hosts via SSH
5
5
  Home-page: https://github.com/yufei-pan/multiSSH3
6
6
  Author: Yufei Pan
@@ -0,0 +1,6 @@
1
+ multiSSH3.py,sha256=xmpPdker87cPs5mcocUo3MdI4SjMsCh4u3MnwJbcGo8,179830
2
+ multissh3-5.96.dist-info/METADATA,sha256=QuuF4JIB_Fv_WcFiYrChIFVt8eCioYYbFJLHri8CTVA,18093
3
+ multissh3-5.96.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
4
+ multissh3-5.96.dist-info/entry_points.txt,sha256=xi2rWWNfmHx6gS8Mmx0rZL2KZz6XWBYP3DWBpWAnnZ0,143
5
+ multissh3-5.96.dist-info/top_level.txt,sha256=tUwttxlnpLkZorSsroIprNo41lYSxjd2ASuL8-EJIJw,10
6
+ multissh3-5.96.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- multiSSH3.py,sha256=PWEXxU31f8mCRPzHqrWyG7DJcKXn99jmyTCT5mfuZoQ,179383
2
- multissh3-5.95.dist-info/METADATA,sha256=GfNp-SWNCY8KyBjmuiK7JWbJWURo0oZ5ltBRAYlC4dw,18093
3
- multissh3-5.95.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
4
- multissh3-5.95.dist-info/entry_points.txt,sha256=xi2rWWNfmHx6gS8Mmx0rZL2KZz6XWBYP3DWBpWAnnZ0,143
5
- multissh3-5.95.dist-info/top_level.txt,sha256=tUwttxlnpLkZorSsroIprNo41lYSxjd2ASuL8-EJIJw,10
6
- multissh3-5.95.dist-info/RECORD,,