multiSSH3 5.59__tar.gz → 5.60__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
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: multiSSH3
3
- Version: 5.59
3
+ Version: 5.60
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
@@ -108,7 +108,7 @@ An example .ssh/config:
108
108
  Host *
109
109
  StrictHostKeyChecking no
110
110
  ControlMaster auto
111
- ControlPath /tmp/%u_ssh_sockets_%r@%h-%p
111
+ ControlPath /run/user/%i/ssh_sockets_%C
112
112
  ControlPersist 3600
113
113
  ```
114
114
 
@@ -80,7 +80,7 @@ An example .ssh/config:
80
80
  Host *
81
81
  StrictHostKeyChecking no
82
82
  ControlMaster auto
83
- ControlPath /tmp/%u_ssh_sockets_%r@%h-%p
83
+ ControlPath /run/user/%i/ssh_sockets_%C
84
84
  ControlPersist 3600
85
85
  ```
86
86
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: multiSSH3
3
- Version: 5.59
3
+ Version: 5.60
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
@@ -108,7 +108,7 @@ An example .ssh/config:
108
108
  Host *
109
109
  StrictHostKeyChecking no
110
110
  ControlMaster auto
111
- ControlPath /tmp/%u_ssh_sockets_%r@%h-%p
111
+ ControlPath /run/user/%i/ssh_sockets_%C
112
112
  ControlPersist 3600
113
113
  ```
114
114
 
@@ -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.59'
57
+ version = '5.60'
58
58
  VERSION = version
59
59
  __version__ = version
60
- COMMIT_DATE = '2025-03-17'
60
+ COMMIT_DATE = '2025-03-27'
61
61
 
62
62
  CONFIG_FILE_CHAIN = ['./multiSSH3.config.json',
63
63
  '~/multiSSH3.config.json',
@@ -226,7 +226,7 @@ class Host:
226
226
  self.stdout = [] # the stdout of the command
227
227
  self.stderr = [] # the stderr of the command
228
228
  self.printedLines = -1 # the number of lines printed on the screen
229
- self.lineNumToReprintSet = set() # whether to reprint the last line
229
+ self.lineNumToReprintSet = set() # line numbers to reprint
230
230
  self.lastUpdateTime = time.monotonic() # the last time the output was updated
231
231
  self.files = files # the files to be copied to the host
232
232
  self.ipmi = ipmi # whether to use ipmi to connect to the host
@@ -1136,20 +1136,37 @@ def __handle_reading_stream(stream,target, host):
1136
1136
  host.lastUpdateTime = time.monotonic()
1137
1137
  current_line = bytearray()
1138
1138
  lastLineCommited = True
1139
+ curser_position = 0
1140
+ previousUpdateTime = time.monotonic()
1139
1141
  for char in iter(lambda:stream.read(1), b''):
1140
1142
  if char == b'\n':
1141
- if (not lastLineCommited) and current_line:
1142
- add_line(current_line,target, host, keepLastLine=False)
1143
- elif lastLineCommited:
1144
- add_line(current_line,target, host, keepLastLine=True)
1143
+ add_line(current_line,target, host, keepLastLine=lastLineCommited)
1145
1144
  current_line = bytearray()
1146
1145
  lastLineCommited = True
1146
+ curser_position = 0
1147
+ previousUpdateTime = time.monotonic()
1148
+ continue
1147
1149
  elif char == b'\r':
1150
+ curser_position = 0
1151
+ elif char == b'\x08':
1152
+ # backspace
1153
+ if curser_position > 0:
1154
+ curser_position -= 1
1155
+ else:
1156
+ # over write the character if the curser is not at the end of the line
1157
+ if curser_position < len(current_line):
1158
+ current_line[curser_position] = char[0]
1159
+ elif curser_position == len(current_line):
1160
+ current_line.append(char[0])
1161
+ else:
1162
+ # curser is bigger than the length of the line
1163
+ current_line += b' '*(curser_position - len(current_line)) + char
1164
+ curser_position += 1
1165
+ if time.monotonic() - previousUpdateTime > 0.1:
1166
+ # if the time since the last update is more than 10ms, we update the output
1148
1167
  add_line(current_line,target, host, keepLastLine=lastLineCommited)
1149
- current_line = bytearray()
1150
1168
  lastLineCommited = False
1151
- else:
1152
- current_line.extend(char)
1169
+ previousUpdateTime = time.monotonic()
1153
1170
  if current_line:
1154
1171
  add_line(current_line,target, host, keepLastLine=lastLineCommited)
1155
1172
 
@@ -2108,7 +2125,9 @@ def __generate_display(stdscr, hosts, lineToDisplay = -1,curserPosition = 0, min
2108
2125
  if host.lineNumToReprintSet:
2109
2126
  # visible range is from host.printedLines - host_window_height + 1 to host.printedLines
2110
2127
  visibleLowerBound = host.printedLines - host_window_height + 1
2111
- for lineNumToReprint in host.lineNumToReprintSet:
2128
+ lineNumToReprintSet = host.lineNumToReprintSet
2129
+ host.lineNumToReprintSet = set()
2130
+ for lineNumToReprint in lineNumToReprintSet:
2112
2131
  # if the line is visible, we will reprint it
2113
2132
  if visibleLowerBound <= lineNumToReprint <= host.printedLines:
2114
2133
  if visibleLowerBound <= 0:
@@ -2121,7 +2140,6 @@ def __generate_display(stdscr, hosts, lineToDisplay = -1,curserPosition = 0, min
2121
2140
  # Thus we will not use any presistent color pair for old lines
2122
2141
  cpl = host.current_color_pair if lineNumToReprint == host.printedLines else [-1,-1,1]
2123
2142
  _curses_add_string_to_window(window=host_window, y=linePos + 1, line=host.output[lineNumToReprint], color_pair_list=cpl,lead_str='│',keep_top_n_lines=1,box_ansi_color=box_ansi_color)
2124
- host.lineNumToReprintSet = set()
2125
2143
  host_window.refresh()
2126
2144
  new_configured = False
2127
2145
  last_refresh_time = time.perf_counter()
File without changes
File without changes
File without changes
File without changes
File without changes