Changes.
[kiosk.git] / gcal_renderer.py
index 19b818d8ad3309890eff6ef0d7f7b4b21ba63aed..edb9546e6a35980a2a225c56d1b6c947ff81ca3a 100644 (file)
@@ -342,12 +342,11 @@ var fn = setInterval(function() {
                 )
             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:
@@ -358,10 +357,10 @@ var fn = setInterval(function() {
             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)