From e66d36591ef7426bbac961b1c12b1980d063ac35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20S=C3=A1nchez?= Date: Mon, 18 Oct 2021 09:12:42 +0200 Subject: [PATCH] solve errors --- autoficher.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/autoficher.py b/autoficher.py index 356c7b3..e91406b 100755 --- a/autoficher.py +++ b/autoficher.py @@ -79,8 +79,6 @@ class AutoFicher(): if args.geoAccuracy: self.config['geo']['accuracy'] = args.geoAccuracy - print(self.config) - def sendReport(self, message): bot = telegram.Bot(token=self.config['telegram']['token']) bot.sendMessage(chat_id=self.config['telegram']['chat_id'], text=str(message)) @@ -155,8 +153,7 @@ class AutoFicher(): self.sendReport('Corriendo en modo debug. No se realizará ninguna acción') if response.status_code == 200: if rj['Repeated']: - time = datetime.strptime(rj['RepeatedTime'], "%Y-%m-%dT%H:%M:%SZ").replace(tzinfo=pytz.utc).astimezone( - pytz.timezone("Europe/Madrid")).strftime("%H:%M") + time = datetime.now().astimezone(pytz.timezone("Europe/Madrid")).strftime("%H:%M") self.sendReport("Se ha realizado un marcaje antes a las %s" % time) else: time = datetime.strptime(self.headers["tn-d"], "'%Y-%m-%dT%H:%M:%SZ'").replace(