From 044e0334d2bfb9c4b076afc562e4fb3d17c7db20 Mon Sep 17 00:00:00 2001 From: nico Date: Mon, 29 Jun 2020 18:59:16 +0200 Subject: flake8 fixup * fix trailing/ leading whitespaces * fix None comparison to use is + add noqa ignore statements for the influx escape replacements + add noqa ignore statements around the bare excepts TODO: This is only a temporary fix for most of the bare excepts, we need further specify those. --- cleanup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cleanup.py') diff --git a/cleanup.py b/cleanup.py index ee9def1..671c466 100755 --- a/cleanup.py +++ b/cleanup.py @@ -38,13 +38,13 @@ class EjabberdCleanup(EjabberdApiCalls): lastdate = None try: lastdate = datetime.datetime.strptime(last_stamp, "%Y-%m-%dT%H:%M:%SZ") - except: + except: # noqa: E722 try: lastdate = datetime.datetime.strptime(last_stamp, "%Y-%m-%dT%H:%M:%S.%fZ") - except: + except: # noqa: E722 logging.error(f"{user}@{host}: not able to parse '{last_stamp}'") return - if lastdate != None and lastdate - datetime.datetime.now() > datetime.timedelta( + if lastdate is not None and lastdate - datetime.datetime.now() > datetime.timedelta( days=self.offline_since_days ): self.delete_user(host, user, f"last seen @ {lastdate}") -- cgit v1.2.3-18-g5258