multiSSH3 5.69__tar.gz → 5.71__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.69
3
+ Version: 5.71
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.69
3
+ Version: 5.71
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.69'
57
+ version = '5.71'
58
58
  VERSION = version
59
59
  __version__ = version
60
- COMMIT_DATE = '2025-05-09'
60
+ COMMIT_DATE = '2025-05-13'
61
61
 
62
62
  CONFIG_FILE_CHAIN = ['./multiSSH3.config.json',
63
63
  '~/multiSSH3.config.json',
@@ -1191,12 +1191,13 @@ def __handle_writing_stream(stream,stop_event,host):
1191
1191
  line = '> ' + ''.join(__keyPressesIn[sentInput]).encode().decode().replace('\n', '↵')
1192
1192
  host.output.append(line)
1193
1193
  host.stdout.append(line)
1194
+ host.lineNumToPrintSet.add(len(host.output)-1)
1194
1195
  sentInput += 1
1195
1196
  host.lastUpdateTime = time.monotonic()
1196
1197
  else:
1197
1198
  time.sleep(0.01) # sleep for 10ms
1198
1199
  if sentInput < len(__keyPressesIn) - 1 :
1199
- eprint(f"Warning: {len(__keyPressesIn)-sentInput} key presses are not sent before the process is terminated!")
1200
+ eprint(f"Warning: {len(__keyPressesIn)-sentInput} lines of key presses are not sent before the process is terminated!")
1200
1201
  # # send the last line
1201
1202
  # if __keyPressesIn and __keyPressesIn[-1]:
1202
1203
  # stream.write(''.join(__keyPressesIn[-1]).encode())
@@ -2263,7 +2264,7 @@ def generate_output(hosts, usejson = False, greppable = False):
2263
2264
  rtnStr += "User Inputs: \n "
2264
2265
  rtnStr += '\n '.join(CMDsOut)
2265
2266
  rtnStr += '\n'
2266
- __keyPressesIn = [[]]
2267
+ __keyPressesIn[-1].clear()
2267
2268
  if __global_suppress_printout and not outputs:
2268
2269
  rtnStr += 'Success'
2269
2270
  return rtnStr
@@ -2438,7 +2439,7 @@ def getStrCommand(hosts = DEFAULT_HOSTS,commands = None,oneonone = DEFAULT_ONE_O
2438
2439
  copy_id = False, unavailable_host_expiry = DEFAULT_UNAVAILABLE_HOST_EXPIRY,no_history = DEFAULT_NO_HISTORY,
2439
2440
  history_file = DEFAULT_HISTORY_FILE, env_file = DEFAULT_ENV_FILE,
2440
2441
  repeat = DEFAULT_REPEAT,interval = DEFAULT_INTERVAL,
2441
- shortend = False):
2442
+ shortend = False,tabSeperated = False):
2442
2443
  _ = called
2443
2444
  _ = returnUnfinished
2444
2445
  _ = willUpdateUnreachableHosts
@@ -2462,7 +2463,10 @@ def getStrCommand(hosts = DEFAULT_HOSTS,commands = None,oneonone = DEFAULT_ONE_O
2462
2463
  commandStr = '"' + '" "'.join(commands) + '"' if commands else ''
2463
2464
  filePath = os.path.abspath(__file__)
2464
2465
  programName = filePath if filePath else 'mssh'
2465
- return f'{programName} {argsStr} {hostStr} {commandStr}'
2466
+ if tabSeperated:
2467
+ return f'{programName}\t{argsStr}\t{hostStr}\t{commandStr}'
2468
+ else:
2469
+ return f'{programName} {argsStr} {hostStr} {commandStr}'
2466
2470
 
2467
2471
  #%% ------------ Record History Block ----------------
2468
2472
  def record_command_history(kwargs):
@@ -2486,7 +2490,7 @@ def record_command_history(kwargs):
2486
2490
  for name in sig.parameters
2487
2491
  if name in kwargs
2488
2492
  }
2489
- strCommand = getStrCommand(**wanted)
2493
+ strCommand = getStrCommand(**wanted,shortend=True,tabSeperated=True)
2490
2494
  with open(history_file, 'a') as f:
2491
2495
  # it follows <timestamp>\t<strCommand>\n
2492
2496
  f.write(f'{int(time.time())}\t{strCommand}\n')
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes