)
return True
except Exception as e:
+ logger.exception(e)
print("********* TRYING TO REFRESH GCAL CLIENT *********")
# self.oauth.refresh_token()
# self.client = self.oauth.calendar_service()
return False
- except:
- raise
def look_for_triggered_events(self) -> bool:
with file_writer.file_writer(constants.gcal_imminent_pagename) as f:
for event in self.sortable_events:
eventstamp = event.start_time
if eventstamp is None:
- return False
+ continue
delta = eventstamp - now
x = int(delta.total_seconds())
- if x > 0 and x <= constants.seconds_per_minute * 3:
+ if x > -120 and x < 4 * constants.seconds_per_minute:
days = divmod(x, constants.seconds_per_day)
hours = divmod(days[1], constants.seconds_per_hour)
minutes = divmod(hours[1], constants.seconds_per_minute)