From f30b929752f4fe42db35971a5530bff2d44a3c16 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Tue, 29 Mar 2016 23:27:59 -0500 Subject: [PATCH 1/2] Make number of days for event search configurable --- i3pystatus/google_calendar.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/i3pystatus/google_calendar.py b/i3pystatus/google_calendar.py index 9fadd01..6fa62c2 100644 --- a/i3pystatus/google_calendar.py +++ b/i3pystatus/google_calendar.py @@ -36,6 +36,7 @@ class GoogleCalendar(IntervalModule, ColorRangeModule): ('format', 'format string'), ("credential_path", "Path to credentials"), ("skip_recurring", "Skip recurring events."), + ("days", "Only show events between now and this many days in the future"), ("urgent_seconds", "Add urgent hint when this many seconds until event startTime"), ("start_color", "Hex or English name for start of color range, eg '#00FF00' or 'green'"), ("end_color", "Hex or English name for end of color range, eg '#FF0000' or 'red'"), @@ -43,12 +44,14 @@ class GoogleCalendar(IntervalModule, ColorRangeModule): required = ('credential_path',) - format = "{summary} ({remaining_time})" - urgent_seconds = 300 interval = 30 - color = '#FFFFFF' - skip_recurring = True + + format = "{summary} ({remaining_time})" credential_path = None + skip_recurring = True + days = 1 + urgent_seconds = 300 + color = '#FFFFFF' service = None credentials = None @@ -119,7 +122,7 @@ class GoogleCalendar(IntervalModule, ColorRangeModule): def get_timerange(self): now = datetime.datetime.utcnow() - later = now + datetime.timedelta(days=1) + later = now + datetime.timedelta(days=self.days) now = now.isoformat() + 'Z' later = later.isoformat() + 'Z' return now, later From 7c25dff1a1fa3aa7b75f53d81cb7217ec83bb88a Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Tue, 29 Mar 2016 23:39:43 -0500 Subject: [PATCH 2/2] Let color default to i3bar color --- i3pystatus/google_calendar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i3pystatus/google_calendar.py b/i3pystatus/google_calendar.py index 6fa62c2..3ba3eee 100644 --- a/i3pystatus/google_calendar.py +++ b/i3pystatus/google_calendar.py @@ -51,7 +51,7 @@ class GoogleCalendar(IntervalModule, ColorRangeModule): skip_recurring = True days = 1 urgent_seconds = 300 - color = '#FFFFFF' + color = None service = None credentials = None