fixes y calendario de google holidays desactivado

Signed-off-by: Omar Sánchez Pizarro <admin@pribyte.cloud>
This commit is contained in:
2025-09-04 14:13:57 +02:00
parent e9ec438183
commit 8123de824e
5 changed files with 13 additions and 8 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
config.json
googleoauth.json
app/__pycache__
venv

View File

@@ -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)

View File

@@ -95,10 +95,11 @@ 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'

View File

@@ -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)

View File

@@ -3,4 +3,4 @@ pytz
google-api-python-client
google-auth-httplib2
google-auth-oauthlib
dateutil