From eb857c898b1354ebf2b71199b944ae766ec39ab3 Mon Sep 17 00:00:00 2001 From: Toby Date: Wed, 20 Sep 2023 02:39:13 +0200 Subject: [PATCH] remove idx --- monitor.py | 5 ++--- sync.py | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/monitor.py b/monitor.py index ee03078..294c910 100755 --- a/monitor.py +++ b/monitor.py @@ -33,12 +33,11 @@ def parse_top_string(data): return load, cpu_percent, ram_total, ram_free class Host(threading.Thread): - def __init__(self, host, port, host_length, idx): + def __init__(self, host, port, host_length): threading.Thread.__init__(self) self.host = host self.port = port self.host_length = host_length - self.idx = idx self.status = 'none' self.row = '' @@ -105,7 +104,7 @@ def main(): continue if not 'port' in host: host['port'] = 22 - hosts.append(Host(host['host'], host['port'] or 22, host_length, i)) + hosts.append(Host(host['host'], host['port'] or 22, host_length)) for host in hosts: host.start() diff --git a/sync.py b/sync.py index 787cab3..95096ea 100755 --- a/sync.py +++ b/sync.py @@ -33,14 +33,13 @@ def parse_top_string(data): return load, cpu_percent, ram_total, ram_free class Host(threading.Thread): - def __init__(self, host, port, user, keys, host_length, idx): + def __init__(self, host, port, user, keys, host_length): threading.Thread.__init__(self) self.host = host self.port = port self.user = user self.keys = keys self.host_length = host_length - self.idx = idx self.status = 'none' self.row = '' @@ -108,7 +107,7 @@ def main(): continue if not 'port' in host: host['port'] = 22 - hosts.append(Host(host['host'], host['port'] or 22, user_name, host_keys, host_length, i)) + hosts.append(Host(host['host'], host['port'] or 22, user_name, host_keys, host_length)) for host in hosts: host.start()