update requirements y solución a mensajes de reporte
This commit is contained in:
@@ -121,17 +121,17 @@ class AutoFicher():
|
||||
response = self.post("check", data, self.headers)
|
||||
rj = json.loads(response.text)
|
||||
|
||||
if response.status_code != 200:
|
||||
time = datetime.strptime(self.headers["tn-d"], "%Y-%m-%dT%H:%M:%SZ").replace(tzinfo=pytz.utc).astimezone(
|
||||
pytz.timezone("Europe/Madrid")).strftime("%H:%M")
|
||||
self.sendReport('Has fichado correctamente a las %s' % time)
|
||||
else:
|
||||
|
||||
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")
|
||||
self.sendReport("Se ha realizado un marcaje antes a las %s" % time)
|
||||
else:
|
||||
self.sendReport("No se ha podido fichar, la web no ha devuelto 200 OK")
|
||||
time = datetime.strptime(self.headers["tn-d"], "%Y-%m-%dT%H:%M:%SZ").replace(tzinfo=pytz.utc).astimezone(pytz.timezone("Europe/Madrid")).strftime("%H:%M")
|
||||
self.sendReport('Has fichado correctamente a las %s' % time)
|
||||
else:
|
||||
self.sendReport("No se ha podido fichar, la web no ha devuelto 200 OK")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user