From 16d268ca9051b94d7b0a207fd5ffdbd302010ff3 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 11 Aug 2022 20:09:14 +0100 Subject: [PATCH] Reformat helpers --- modules/helpers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/helpers.py b/modules/helpers.py index 58ad4a3..63534ed 100644 --- a/modules/helpers.py +++ b/modules/helpers.py @@ -1,6 +1,7 @@ import main from modules import chankeep + def get_first_relay(net): """ Get the first relay in the network. @@ -9,7 +10,7 @@ def get_first_relay(net): :return: IRCPool instance for the IRC bot """ cur_relay = 0 - max_relay = len(main.network[net].relays.keys())+1 + max_relay = len(main.network[net].relays.keys()) + 1 activeRelays = chankeep.getActiveRelays(net) while cur_relay != max_relay: cur_relay += 1 @@ -20,6 +21,7 @@ def get_first_relay(net): return main.IRCPool[name] return None + def is_first_relay(net, num): """ Determine if we are the first relay for the network. @@ -32,4 +34,4 @@ def is_first_relay(net, num): while cur_relay > max_relay: name = net + str(cur_relay) if name in main.IRCPool.keys(): - return cur_relay == num \ No newline at end of file + return cur_relay == num