multiSSH3 5.71__tar.gz → 5.72__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.71
3
+ Version: 5.72
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.71
3
+ Version: 5.72
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
@@ -54,10 +54,10 @@ except AttributeError:
54
54
  # If neither is available, use a dummy decorator
55
55
  def cache_decorator(func):
56
56
  return func
57
- version = '5.71'
57
+ version = '5.72'
58
58
  VERSION = version
59
59
  __version__ = version
60
- COMMIT_DATE = '2025-05-13'
60
+ COMMIT_DATE = '2025-05-21'
61
61
 
62
62
  CONFIG_FILE_CHAIN = ['./multiSSH3.config.json',
63
63
  '~/multiSSH3.config.json',
@@ -1854,19 +1854,19 @@ def _get_hosts_to_display (hosts, max_num_hosts, hosts_to_display = None):
1854
1854
  waiting_hosts = [host for host in hosts if host.returncode is None and not host.output]
1855
1855
  new_hosts_to_display = (running_hosts + failed_hosts + finished_hosts + waiting_hosts)[:max_num_hosts]
1856
1856
  if not hosts_to_display:
1857
- return new_hosts_to_display , {'running':len(running_hosts), 'failed':len(failed_hosts), 'finished':len(finished_hosts), 'waiting':len(waiting_hosts)}
1857
+ return new_hosts_to_display , {'running':len(running_hosts), 'failed':len(failed_hosts), 'finished':len(finished_hosts), 'waiting':len(waiting_hosts)}, set(new_hosts_to_display)
1858
1858
  # we will compare the new_hosts_to_display with the old one, if some hosts are not in their original position, we will reprint all lines
1859
+ rearrangedHosts = set()
1859
1860
  for i, host in enumerate(new_hosts_to_display):
1860
1861
  if host not in hosts_to_display or i != hosts_to_display.index(host):
1861
- host.lineNumToPrintSet.update(range(len(host.output)))
1862
- return new_hosts_to_display , {'running':len(running_hosts), 'failed':len(failed_hosts), 'finished':len(finished_hosts), 'waiting':len(waiting_hosts)}
1862
+ rearrangedHosts.add(host)
1863
+ return new_hosts_to_display , {'running':len(running_hosts), 'failed':len(failed_hosts), 'finished':len(finished_hosts), 'waiting':len(waiting_hosts)}, rearrangedHosts
1863
1864
 
1864
1865
  def __generate_display(stdscr, hosts, lineToDisplay = -1,curserPosition = 0, min_char_len = DEFAULT_CURSES_MINIMUM_CHAR_LEN, min_line_len = DEFAULT_CURSES_MINIMUM_LINE_LEN,single_window=DEFAULT_SINGLE_WINDOW, config_reason = 'New Configuration'):
1865
1866
  _ = config_reason
1866
1867
  try:
1867
1868
  box_ansi_color = None
1868
1869
  org_dim = stdscr.getmaxyx()
1869
- new_configured = True
1870
1870
  # To do this, first we need to know the size of the terminal
1871
1871
  max_y, max_x = org_dim
1872
1872
  # we will use one line to print the aggregated stats for the hosts.
@@ -1890,7 +1890,7 @@ def __generate_display(stdscr, hosts, lineToDisplay = -1,curserPosition = 0, min
1890
1890
  max_num_hosts = max_num_hosts_x * max_num_hosts_y
1891
1891
  if max_num_hosts < 1:
1892
1892
  return (lineToDisplay,curserPosition , min_char_len, min_line_len, single_window, 'Terminal too small to display any hosts')
1893
- hosts_to_display , host_stats = _get_hosts_to_display(hosts, max_num_hosts)
1893
+ hosts_to_display , host_stats, rearrangedHosts = _get_hosts_to_display(hosts, max_num_hosts)
1894
1894
  if len(hosts_to_display) == 0:
1895
1895
  return (lineToDisplay,curserPosition , min_char_len, min_line_len, single_window, 'No hosts to display')
1896
1896
  # Now we calculate the actual number of hosts we will display for x and y
@@ -2081,16 +2081,15 @@ def __generate_display(stdscr, hosts, lineToDisplay = -1,curserPosition = 0, min
2081
2081
  if time.perf_counter() - last_refresh_time < 0.01:
2082
2082
  time.sleep(max(0,0.01 - time.perf_counter() + last_refresh_time))
2083
2083
  #stdscr.clear()
2084
- hosts_to_display, host_stats = _get_hosts_to_display(hosts, max_num_hosts,hosts_to_display)
2085
2084
  for host_window, host in zip(host_windows, hosts_to_display):
2086
2085
  # we will only update the window if there is new output or the window is not fully printed
2087
- if new_configured:
2088
- host.lineNumToPrintSet.update(range(len(host.output)))
2086
+ if host in rearrangedHosts:
2089
2087
  linePrintOut = f'{host.name}:[{host.command}]'.replace('\n', ' ').replace('\r', ' ').strip()
2090
2088
  _curses_add_string_to_window(window=host_window, y=0, line=linePrintOut, color_pair_list=[-1, -1, 1],centered=True,fill_char='─',lead_str='┼',box_ansi_color=box_ansi_color)
2091
2089
  # clear the window
2092
2090
  for i in range(host_window_height - 1):
2093
2091
  _curses_add_string_to_window(window=host_window, color_pair_list=[-1, -1, 1], y=i + 1,lead_str='│',keep_top_n_lines=1,box_ansi_color=box_ansi_color)
2092
+ host.lineNumToPrintSet.update(range(len(host.output)))
2094
2093
  # for i in range(host.printedLines, len(host.output)):
2095
2094
  # _curses_add_string_to_window(window=host_window, y=i + 1, line=host.output[i], color_pair_list=host.current_color_pair,lead_str='│',keep_top_n_lines=1,box_ansi_color=box_ansi_color)
2096
2095
  # host.printedLines = len(host.output)
@@ -2111,7 +2110,7 @@ def __generate_display(stdscr, hosts, lineToDisplay = -1,curserPosition = 0, min
2111
2110
  if org_dim != stdscr.getmaxyx():
2112
2111
  return (lineToDisplay,curserPosition , min_char_len, min_line_len, single_window, 'Terminal resize detected')
2113
2112
  host_window.refresh()
2114
- new_configured = False
2113
+ hosts_to_display, host_stats,rearrangedHosts = _get_hosts_to_display(hosts, max_num_hosts,hosts_to_display)
2115
2114
  last_refresh_time = time.perf_counter()
2116
2115
  except Exception as e:
2117
2116
  import traceback
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes