From abe1dde57ec87467dd65e00cf2ce3235338a41e9 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Wed, 18 Dec 2019 04:03:26 -0600 Subject: [PATCH] pep8 refactor netcheck --- src/communicatorutils/netcheck.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/communicatorutils/netcheck.py b/src/communicatorutils/netcheck.py index 7f731e75..d7aaace4 100755 --- a/src/communicatorutils/netcheck.py +++ b/src/communicatorutils/netcheck.py @@ -23,11 +23,14 @@ from utils import netutils from onionrutils import localcommand, epoch from . import restarttor def net_check(comm_inst): - '''Check if we are connected to the internet or not when we can't connect to any peers''' - rec = False # for detecting if we have received incoming connections recently + '''Check if we are connected to the internet + or not when we can't connect to any peers''' + # for detecting if we have received incoming connections recently + rec = False if len(comm_inst.onlinePeers) == 0: try: - if (epoch.get_epoch() - int(localcommand.local_command('/lastconnect'))) <= 60: + if (epoch.get_epoch() - int(localcommand.local_command + ('/lastconnect'))) <= 60: comm_inst.isOnline = True rec = True except ValueError: