solve errors

This commit is contained in:
Omar Sánchez
2021-10-18 09:12:42 +02:00
parent 86de92e356
commit e66d36591e

View File

@@ -79,8 +79,6 @@ class AutoFicher():
if args.geoAccuracy: if args.geoAccuracy:
self.config['geo']['accuracy'] = args.geoAccuracy self.config['geo']['accuracy'] = args.geoAccuracy
print(self.config)
def sendReport(self, message): def sendReport(self, message):
bot = telegram.Bot(token=self.config['telegram']['token']) bot = telegram.Bot(token=self.config['telegram']['token'])
bot.sendMessage(chat_id=self.config['telegram']['chat_id'], text=str(message)) 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') self.sendReport('Corriendo en modo debug. No se realizará ninguna acción')
if response.status_code == 200: if response.status_code == 200:
if rj['Repeated']: if rj['Repeated']:
time = datetime.strptime(rj['RepeatedTime'], "%Y-%m-%dT%H:%M:%SZ").replace(tzinfo=pytz.utc).astimezone( time = datetime.now().astimezone(pytz.timezone("Europe/Madrid")).strftime("%H:%M")
pytz.timezone("Europe/Madrid")).strftime("%H:%M")
self.sendReport("Se ha realizado un marcaje antes a las %s" % time) self.sendReport("Se ha realizado un marcaje antes a las %s" % time)
else: else:
time = datetime.strptime(self.headers["tn-d"], "'%Y-%m-%dT%H:%M:%SZ'").replace( time = datetime.strptime(self.headers["tn-d"], "'%Y-%m-%dT%H:%M:%SZ'").replace(