fixes y calendario de google holidays desactivado
Signed-off-by: Omar Sánchez Pizarro <admin@pribyte.cloud>
This commit is contained in:
@@ -18,6 +18,8 @@ class ArgParser:
|
||||
optionalArgs.add_argument('-h', '--help', action="help", help="Esta ayuda")
|
||||
optionalArgs.add_argument('-d', '--debug', action='store_true')
|
||||
|
||||
optionalArgs.add_argument('-f', '--force', action='store_true')
|
||||
|
||||
optionalArgs.add_argument('-c', '--config', help="Rúta al archivo de configuración")
|
||||
optionalArgs.add_argument('-u', '--user', help="Usuario")
|
||||
optionalArgs.add_argument('-glo', '--geoLongitude', help="GEO Longitud", type=float)
|
||||
|
||||
@@ -95,12 +95,13 @@ class GoogleCalendar:
|
||||
if event['organizer']['displayName'] == 'autoficher':
|
||||
return 'Forzado desde autoficher - ' + event.get("summary", "Sin Título")
|
||||
|
||||
if 'description' in event and ("Cataluña" in event['description'] or 'Día festivo' in event[
|
||||
'description'] or 'Celebración\n' in event['description']) and not 'Cambio de horario' in event[
|
||||
'summary']:
|
||||
return event['summary']
|
||||
#Desactivado por que no funcionaba muy bien ese calendario... se han puesto en el calendario autoficher los dias festivos correctos
|
||||
#if 'description' in event and ("Cataluña" in event['description'] or 'Día festivo' in event[
|
||||
# 'description'] or 'Celebración\n' in event['description']) and not 'Cambio de horario' in event[
|
||||
# 'summary']:
|
||||
# return event['summary']
|
||||
except HttpError as error:
|
||||
print(f'An error occurred: {error}')
|
||||
return 'Error de llama a Google Calendar'
|
||||
|
||||
return False
|
||||
return False
|
||||
|
||||
@@ -75,8 +75,9 @@ class timenetManager:
|
||||
|
||||
calendar = google_calendar.GoogleCalendar()
|
||||
calendar = calendar.getEvent()
|
||||
if calendar:
|
||||
if calendar and not args.force:
|
||||
self.addMessage("🟥🕐 Comprobación de calendario: " + calendar)
|
||||
self.sendReport()
|
||||
return
|
||||
|
||||
typ = 0
|
||||
@@ -129,7 +130,7 @@ class timenetManager:
|
||||
try:
|
||||
rj = json.loads(response.text)
|
||||
except:
|
||||
self.addMessage("La respuesta al hacer check no es correcta... algo ha pasado :/")
|
||||
self.addMessage("La respuesta al hacer check no es correcta... algo ha pasado :/ - %s" % (response.text))
|
||||
self.sendReport()
|
||||
exit(20)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user