multiSSH3 5.45__py3-none-any.whl → 5.46__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: multiSSH3
3
- Version: 5.45
3
+ Version: 5.46
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=zwE1pgmNe285WDdv8E1eSOyDlxocrHtryWh-mnc8lGM,135558
2
+ multiSSH3-5.46.dist-info/METADATA,sha256=WWIQS5igJ0S3Yrr27PpXOlv2IGdLYHvZfoQ2SB2bamg,18001
3
+ multiSSH3-5.46.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
4
+ multiSSH3-5.46.dist-info/entry_points.txt,sha256=xi2rWWNfmHx6gS8Mmx0rZL2KZz6XWBYP3DWBpWAnnZ0,143
5
+ multiSSH3-5.46.dist-info/top_level.txt,sha256=tUwttxlnpLkZorSsroIprNo41lYSxjd2ASuL8-EJIJw,10
6
+ multiSSH3-5.46.dist-info/RECORD,,
multiSSH3.py CHANGED
@@ -46,8 +46,9 @@ except AttributeError:
46
46
  # If neither is available, use a dummy decorator
47
47
  def cache_decorator(func):
48
48
  return func
49
- version = '5.45'
49
+ version = '5.46'
50
50
  VERSION = version
51
+ COMMIT_DATE = '2025-01-30'
51
52
 
52
53
  CONFIG_FILE_CHAIN = ['./multiSSH3.config.json',
53
54
  '~/multiSSH3.config.json',
@@ -1718,13 +1719,16 @@ def _curses_add_string_to_window(window, line = '', y = 0, x = 0, number_of_char
1718
1719
  charsWritten = 0
1719
1720
  boxAttr = __parse_ansi_escape_sequence_to_curses_attr(box_ansi_color)
1720
1721
  # first add the lead_str
1721
- window.addnstr(y, x, lead_str, numChar, boxAttr)
1722
- charsWritten = min(len(lead_str), numChar)
1722
+ if len(lead_str) > 0:
1723
+ window.addnstr(y, x, lead_str, numChar, boxAttr)
1724
+ charsWritten = min(len(lead_str), numChar)
1723
1725
  # process centering
1724
1726
  if centered:
1725
1727
  fill_length = numChar - len(lead_str) - len(trail_str) - sum([len(segment) for segment in segments if not segment.startswith("\x1b[")])
1726
- window.addnstr(y, x + charsWritten, fill_char * (fill_length // 2 // len(fill_char)), numChar - charsWritten, boxAttr)
1727
- charsWritten += min(len(fill_char * (fill_length // 2)), numChar - charsWritten)
1728
+ leading_fill_length = fill_length // 2
1729
+ if leading_fill_length > 0:
1730
+ window.addnstr(y, x + charsWritten, fill_char * (leading_fill_length // len(fill_char) + 1), leading_fill_length, boxAttr)
1731
+ charsWritten += leading_fill_length
1728
1732
  # add the segments
1729
1733
  for segment in segments:
1730
1734
  if not segment:
@@ -1734,17 +1738,17 @@ def _curses_add_string_to_window(window, line = '', y = 0, x = 0, number_of_char
1734
1738
  newAttr = __parse_ansi_escape_sequence_to_curses_attr(segment,color_pair_list)
1735
1739
  else:
1736
1740
  # Add text with current color
1737
- if charsWritten < numChar:
1741
+ if charsWritten < numChar and len(segment) > 0:
1738
1742
  window.addnstr(y, x + charsWritten, segment, numChar - charsWritten, color_pair_list[2])
1739
1743
  charsWritten += min(len(segment), numChar - charsWritten)
1740
1744
  # if we have finished printing segments but we still have space, we will fill it with fill_char
1741
- if charsWritten + len(trail_str) < numChar:
1742
- fillStr = fill_char * ((numChar - charsWritten - len(trail_str))//len(fill_char))
1743
- #fillStr = f'{color_pair_list}'
1744
- window.addnstr(y, x + charsWritten, fillStr + trail_str, numChar - charsWritten, boxAttr)
1745
- charsWritten += numChar - charsWritten
1746
- else:
1745
+ trail_fill_length = numChar - charsWritten - len(trail_str)
1746
+ if trail_fill_length > 0:
1747
+ window.addnstr(y, x + charsWritten,fill_char * (trail_fill_length // len(fill_char) + 1), trail_fill_length, boxAttr)
1748
+ charsWritten += trail_fill_length
1749
+ if len(trail_str) > 0 and charsWritten < numChar:
1747
1750
  window.addnstr(y, x + charsWritten, trail_str, numChar - charsWritten, boxAttr)
1751
+ charsWritten += min(len(trail_str), numChar - charsWritten)
1748
1752
 
1749
1753
  def _get_hosts_to_display (hosts, max_num_hosts, hosts_to_display = None):
1750
1754
  '''
@@ -2767,7 +2771,7 @@ def main():
2767
2771
  parser.add_argument('--store_config_file',type = str,nargs='?',help=f'Store the default config file from command line argument and current config. Same as --store_config_file --config_file=<path>',const='multiSSH3.config.json')
2768
2772
  parser.add_argument('--debug', action='store_true', help='Print debug information')
2769
2773
  parser.add_argument('-ci','--copy_id', action='store_true', help='Copy the ssh id to the hosts')
2770
- parser.add_argument("-V","--version", action='version', version=f'%(prog)s {version} with [ {", ".join(_binPaths.keys())} ] by {AUTHOR} ({AUTHOR_EMAIL})')
2774
+ parser.add_argument("-V","--version", action='version', version=f'%(prog)s {version} @ {COMMIT_DATE} with [ {", ".join(_binPaths.keys())} ] by {AUTHOR} ({AUTHOR_EMAIL})')
2771
2775
 
2772
2776
  # parser.add_argument('-u', '--user', metavar='user', type=str, nargs=1,
2773
2777
  # help='the user to use to connect to the hosts')
@@ -1,6 +0,0 @@
1
- multiSSH3.py,sha256=2rWmKOIbJ4_iRZnRdghYiCpndZbnpXcqPNsL6HCL8xY,135383
2
- multiSSH3-5.45.dist-info/METADATA,sha256=MwSMoniNIAsjCvkxg6o3tkePVfYMYZJKxVDvEytPAVs,18001
3
- multiSSH3-5.45.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
4
- multiSSH3-5.45.dist-info/entry_points.txt,sha256=xi2rWWNfmHx6gS8Mmx0rZL2KZz6XWBYP3DWBpWAnnZ0,143
5
- multiSSH3-5.45.dist-info/top_level.txt,sha256=tUwttxlnpLkZorSsroIprNo41lYSxjd2ASuL8-EJIJw,10
6
- multiSSH3-5.45.dist-info/RECORD,,