multiSSH3 5.52__tar.gz → 5.54__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.
- {multissh3-5.52 → multissh3-5.54}/PKG-INFO +1 -1
- {multissh3-5.52 → multissh3-5.54}/multiSSH3.egg-info/PKG-INFO +1 -1
- {multissh3-5.52 → multissh3-5.54}/multiSSH3.py +13 -10
- {multissh3-5.52 → multissh3-5.54}/README.md +0 -0
- {multissh3-5.52 → multissh3-5.54}/multiSSH3.egg-info/SOURCES.txt +0 -0
- {multissh3-5.52 → multissh3-5.54}/multiSSH3.egg-info/dependency_links.txt +0 -0
- {multissh3-5.52 → multissh3-5.54}/multiSSH3.egg-info/entry_points.txt +0 -0
- {multissh3-5.52 → multissh3-5.54}/multiSSH3.egg-info/requires.txt +0 -0
- {multissh3-5.52 → multissh3-5.54}/multiSSH3.egg-info/top_level.txt +0 -0
- {multissh3-5.52 → multissh3-5.54}/setup.cfg +0 -0
- {multissh3-5.52 → multissh3-5.54}/setup.py +0 -0
- {multissh3-5.52 → multissh3-5.54}/test/test.py +0 -0
- {multissh3-5.52 → multissh3-5.54}/test/testCurses.py +0 -0
- {multissh3-5.52 → multissh3-5.54}/test/testCursesOld.py +0 -0
- {multissh3-5.52 → multissh3-5.54}/test/testPerfCompact.py +0 -0
- {multissh3-5.52 → multissh3-5.54}/test/testPerfExpand.py +0 -0
|
@@ -54,7 +54,7 @@ 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.
|
|
57
|
+
version = '5.54'
|
|
58
58
|
VERSION = version
|
|
59
59
|
__version__ = version
|
|
60
60
|
COMMIT_DATE = '2025-03-01'
|
|
@@ -491,10 +491,10 @@ def replace_magic_strings(string,keys,value,case_sensitive=False):
|
|
|
491
491
|
return string
|
|
492
492
|
|
|
493
493
|
def pretty_format_table(data, delimiter = '\t',header = None):
|
|
494
|
-
version = 1.
|
|
494
|
+
version = 1.11
|
|
495
495
|
if not data:
|
|
496
496
|
return ''
|
|
497
|
-
if
|
|
497
|
+
if isinstance(data, str):
|
|
498
498
|
data = data.strip('\n').split('\n')
|
|
499
499
|
data = [line.split(delimiter) for line in data]
|
|
500
500
|
elif isinstance(data, dict):
|
|
@@ -506,7 +506,7 @@ def pretty_format_table(data, delimiter = '\t',header = None):
|
|
|
506
506
|
else:
|
|
507
507
|
# it is a dict of lists
|
|
508
508
|
data = [[key] + list(value) for key, value in data.items()]
|
|
509
|
-
elif
|
|
509
|
+
elif not isinstance(data, list):
|
|
510
510
|
data = list(data)
|
|
511
511
|
# format the list into 2d list of list of strings
|
|
512
512
|
if isinstance(data[0], dict):
|
|
@@ -521,6 +521,9 @@ def pretty_format_table(data, delimiter = '\t',header = None):
|
|
|
521
521
|
#col_widths[c] = max(len(row[c]) for row in data)
|
|
522
522
|
# handle ansii escape sequences
|
|
523
523
|
col_widths[c] = max(len(re.sub(r'\x1b\[[0-?]*[ -/]*[@-~]','',row[c])) for row in data)
|
|
524
|
+
if header:
|
|
525
|
+
header_widths = [len(re.sub(r'\x1b\[[0-?]*[ -/]*[@-~]', '', col)) for col in header]
|
|
526
|
+
col_widths = [max(col_widths[i], header_widths[i]) for i in range(num_cols)]
|
|
524
527
|
# Build the row format string
|
|
525
528
|
row_format = ' | '.join('{{:<{}}}'.format(width) for width in col_widths)
|
|
526
529
|
# Print the header
|
|
@@ -1235,9 +1238,9 @@ def run_command(host, sem, timeout=60,passwds=None, retry_limit = 5):
|
|
|
1235
1238
|
host.command = replace_magic_strings(host.command,['#PASSWD#','#PASSWORD#'],passwds,case_sensitive=False)
|
|
1236
1239
|
host.command = replace_magic_strings(host.command,['#UUID#'],str(host.uuid),case_sensitive=False)
|
|
1237
1240
|
formatedCMD = []
|
|
1238
|
-
if host.extraargs and
|
|
1241
|
+
if host.extraargs and isinstance(host.extraargs, str):
|
|
1239
1242
|
extraargs = host.extraargs.split()
|
|
1240
|
-
elif host.extraargs and
|
|
1243
|
+
elif host.extraargs and isinstance(host.extraargs, list):
|
|
1241
1244
|
extraargs = [str(arg) for arg in host.extraargs]
|
|
1242
1245
|
else:
|
|
1243
1246
|
extraargs = []
|
|
@@ -2374,7 +2377,7 @@ def formHostStr(host) -> str:
|
|
|
2374
2377
|
"""
|
|
2375
2378
|
if not host or len(host) == 0:
|
|
2376
2379
|
return 'EMPTY_HOSTS'
|
|
2377
|
-
if
|
|
2380
|
+
if isinstance(host, str):
|
|
2378
2381
|
host = set(host.replace(',',' ').replace('\n',' ').replace('\r',' ').replace('\t',' ').replace(';', ' ').replace('|', ' ').replace('/', ' ').replace('&',' ').split())
|
|
2379
2382
|
else:
|
|
2380
2383
|
host = set(host)
|
|
@@ -2426,7 +2429,7 @@ def getStrCommand(hosts = DEFAULT_HOSTS,commands = None,oneonone = DEFAULT_ONE_O
|
|
|
2426
2429
|
single_window = DEFAULT_SINGLE_WINDOW,file_sync = False,error_only = DEFAULT_ERROR_ONLY, identity_file = DEFAULT_IDENTITY_FILE,
|
|
2427
2430
|
copy_id = False,
|
|
2428
2431
|
shortend = False):
|
|
2429
|
-
hosts = hosts if
|
|
2432
|
+
hosts = hosts if isinstance(hosts,str) else frozenset(hosts)
|
|
2430
2433
|
hostStr = formHostStr(hosts)
|
|
2431
2434
|
files = frozenset(files) if files else None
|
|
2432
2435
|
argsStr = __formCommandArgStr(oneonone = oneonone, timeout = timeout,password = password,
|
|
@@ -2540,10 +2543,10 @@ def run_command_on_hosts(hosts = DEFAULT_HOSTS,commands = None,oneonone = DEFAUL
|
|
|
2540
2543
|
if not commands:
|
|
2541
2544
|
commands = []
|
|
2542
2545
|
else:
|
|
2543
|
-
commands = [commands] if
|
|
2546
|
+
commands = [commands] if isinstance(commands,str) else commands
|
|
2544
2547
|
# reformat commands into a list of strings, join the iterables if they are not strings
|
|
2545
2548
|
try:
|
|
2546
|
-
commands = [' '.join(command) if not
|
|
2549
|
+
commands = [' '.join(command) if not isinstance(command,str) else command for command in commands]
|
|
2547
2550
|
except:
|
|
2548
2551
|
pass
|
|
2549
2552
|
eprint(f"Warning: commands should ideally be a list of strings. Now mssh had failed to convert {commands!r} to a list of strings. Continuing anyway but expect failures.")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|