multiSSH3 5.98__tar.gz → 5.99__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.

Potentially problematic release.


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

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: multiSSH3
3
- Version: 5.98
3
+ Version: 5.99
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: multiSSH3
3
- Version: 5.98
3
+ Version: 5.99
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
@@ -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.98'
87
+ version = '5.99'
88
88
  VERSION = version
89
89
  __version__ = version
90
90
  COMMIT_DATE = '2025-10-24'
@@ -2839,7 +2839,7 @@ def mergeOutput(merging_hostnames,outputs_by_hostname,output,diff_display_thresh
2839
2839
  indexes = Counter({hostname: 0 for hostname in merging_hostnames})
2840
2840
  working_index_keys = set(merging_hostnames)
2841
2841
  previousBuddies = set()
2842
- hostnameWrapper = textwrap.TextWrapper(width=line_length -1, tabsize=4, replace_whitespace=False, drop_whitespace=False, break_on_hyphens=False,initial_indent=' ', subsequent_indent='- ')
2842
+ hostnameWrapper = textwrap.TextWrapper(width=line_length -1, tabsize=4, replace_whitespace=False, drop_whitespace=False, break_on_hyphens=False,initial_indent=' ', subsequent_indent='- ')
2843
2843
  hostnameWrapper.wordsep_simple_re = re.compile(r'([,]+)')
2844
2844
  diff_display_item_count = max(1,int(max(map(len, outputs_by_hostname.values())) * (1 - diff_display_threshold)))
2845
2845
  def get_multiset_index_for_hostname(hostname):
@@ -2874,6 +2874,13 @@ def mergeOutput(merging_hostnames,outputs_by_hostname,output,diff_display_thresh
2874
2874
  # futures[hostname] # ensure it's initialized
2875
2875
  futures = {hostname: get_multiset_index_for_hostname(hostname) for hostname in merging_hostnames}
2876
2876
  currentLines = defaultdict(set)
2877
+ color_cap = get_terminal_color_capability()
2878
+ if color_cap == 'None':
2879
+ green_str = ''
2880
+ reset_str = ''
2881
+ else:
2882
+ green_str = rgb_to_ansi_color_string(*COLOR_PALETTE.get('green', __DEFAULT_COLOR_PALETTE['green']))
2883
+ reset_str = '\033[0m'
2877
2884
  for hostname in merging_hostnames:
2878
2885
  currentLines[outputs_by_hostname[hostname][0]].add(hostname)
2879
2886
  while indexes:
@@ -2911,14 +2918,18 @@ def mergeOutput(merging_hostnames,outputs_by_hostname,output,diff_display_thresh
2911
2918
  if buddy != previousBuddies:
2912
2919
  hostnameStr = ','.join(compact_hostnames(buddy))
2913
2920
  hostnameLines = hostnameWrapper.wrap(hostnameStr)
2914
- hostnameLines = [line.ljust(line_length) for line in hostnameLines]
2915
- color = int_to_unique_ansi_color(hash(hostnameStr)) if len(buddy) < len(merging_hostnames) else ''
2916
- if color:
2917
- color = f"\033[0m{color}"
2918
- hostnameLines[0] = f"{color}{hostnameLines[0]}"
2921
+ # hostnameLines = [line.ljust(line_length) for line in hostnameLines]
2922
+ if color_cap == 'None':
2923
+ hostnameLines[0] = f"■{hostnameLines[0]}"
2924
+ elif len(buddy) < len(merging_hostnames):
2925
+ color = int_to_unique_ansi_color(hash(hostnameStr))
2926
+ hostnameLines[0] = f"{color}■{hostnameLines[0]}"
2927
+ hostnameLines[-1] += reset_str
2928
+ else:
2929
+ hostnameLines[0] = f"{green_str}■{reset_str}{hostnameLines[0]}"
2919
2930
  output.extend(hostnameLines)
2920
2931
  previousBuddies = buddy
2921
- output.append(lineToAdd.ljust(line_length))
2932
+ output.append(lineToAdd)
2922
2933
  currentLines[lineToAdd].difference_update(buddy)
2923
2934
  if not currentLines[lineToAdd]:
2924
2935
  del currentLines[lineToAdd]
@@ -2946,19 +2957,22 @@ def mergeOutputs(outputs_by_hostname, merge_groups, remaining_hostnames, diff_di
2946
2957
  if color_cap == 'None':
2947
2958
  color_line = ''
2948
2959
  color_reset = ''
2960
+ green_str = ''
2949
2961
  else:
2950
2962
  color_line = rgb_to_ansi_color_string(*COLOR_PALETTE.get('white', __DEFAULT_COLOR_PALETTE['white']))
2951
2963
  color_reset = '\033[0m'
2964
+ green_str = rgb_to_ansi_color_string(*COLOR_PALETTE.get('green', __DEFAULT_COLOR_PALETTE['green']))
2952
2965
  output.append(color_line+'─'*(line_length)+color_reset)
2953
- hostnameWrapper = textwrap.TextWrapper(width=line_length - 1, tabsize=4, replace_whitespace=False, drop_whitespace=False, break_on_hyphens=False,initial_indent=' ', subsequent_indent='- ')
2966
+ hostnameWrapper = textwrap.TextWrapper(width=line_length - 1, tabsize=4, replace_whitespace=False, drop_whitespace=False, break_on_hyphens=False,initial_indent=' ', subsequent_indent='- ')
2954
2967
  hostnameWrapper.wordsep_simple_re = re.compile(r'([,]+)')
2955
2968
  for merging_hostnames in merge_groups:
2956
2969
  mergeOutput(merging_hostnames, outputs_by_hostname, output, diff_display_threshold,line_length)
2957
2970
  output.append(color_line+'─'*(line_length)+color_reset)
2958
2971
  for hostname in remaining_hostnames:
2959
2972
  hostnameLines = hostnameWrapper.wrap(','.join(compact_hostnames([hostname])))
2960
- output.extend(line.ljust(line_length ) for line in hostnameLines)
2961
- output.extend(line.ljust(line_length ) for line in outputs_by_hostname[hostname])
2973
+ hostnameLines[0] = f"{green_str}■{color_reset}{hostnameLines[0]}"
2974
+ output.extend(hostnameLines)
2975
+ output.extend(outputs_by_hostname[hostname])
2962
2976
  output.append(color_line+'─'*(line_length)+color_reset)
2963
2977
  if output:
2964
2978
  output.pop()
@@ -3148,12 +3162,12 @@ def generate_output(hosts, usejson = False, greppable = False,quiet = False,enco
3148
3162
  outputs = mergeOutputs(outputs_by_hostname, merge_groups,remaining_hostnames, diff_display_threshold,line_length)
3149
3163
  if keyPressesIn[-1]:
3150
3164
  CMDsOut = [''.join(cmd).encode(encoding=encoding,errors='backslashreplace').decode(encoding=encoding,errors='backslashreplace').replace('\\n', '↵') for cmd in keyPressesIn if cmd]
3151
- outputs.append(color_reset_str + " User Inputs:".ljust(line_length,'─'))
3165
+ outputs.append(color_reset_str + " User Inputs:".ljust(line_length,'─'))
3152
3166
  cmdOut = []
3153
3167
  for line in CMDsOut:
3154
3168
  cmdOut.extend(textwrap.wrap(line, width=line_length-1, tabsize=4, replace_whitespace=False, drop_whitespace=False,
3155
3169
  initial_indent=' ', subsequent_indent='-'))
3156
- outputs.extend(cmd.ljust(line_length) for cmd in cmdOut)
3170
+ outputs.extend(cmdOut)
3157
3171
  keyPressesIn[-1].clear()
3158
3172
  if not outputs:
3159
3173
  if quiet:
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes