From eab55a96c13d58b25cc9596137dbbe6a69f58a39 Mon Sep 17 00:00:00 2001 From: Josiah Schwab Date: Thu, 9 Jan 2014 09:45:30 -0800 Subject: [PATCH 1/2] fix typos in comment --- ical2org.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ical2org.py b/ical2org.py index 9390796..ece80ec 100755 --- a/ical2org.py +++ b/ical2org.py @@ -8,7 +8,7 @@ # Change here your local timezone LOCAL_TZ = timezone("Europe/Paris") -# Window lenght in days (left & right from current time). Has to be possitive. +# Window length in days (left & right from current time). Has to be positive. WINDOW = 90 # leave empty if you don't want to attach any tag to recurring events RECUR_TAG = ":RECURRING:" From 6500f937a3e019fc1d21d8e80493992aaa0d9242 Mon Sep 17 00:00:00 2001 From: Josiah Schwab Date: Thu, 9 Jan 2014 09:47:11 -0800 Subject: [PATCH 2/2] add support for asymmetric time windowing --- ical2org.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ical2org.py b/ical2org.py index ece80ec..22714ed 100755 --- a/ical2org.py +++ b/ical2org.py @@ -9,7 +9,8 @@ # Change here your local timezone LOCAL_TZ = timezone("Europe/Paris") # Window length in days (left & right from current time). Has to be positive. -WINDOW = 90 +LEFT_WINDOW = 30 # into the past +RIGHT_WINDOW = 90 # into the future # leave empty if you don't want to attach any tag to recurring events RECUR_TAG = ":RECURRING:" @@ -196,8 +197,8 @@ def next(self): cal = Calendar.from_ical(fh.read()) now = datetime.now(utc) -start = now - timedelta( days = WINDOW) -end = now + timedelta( days = WINDOW) +start = now - timedelta( days = LEFT_WINDOW) +end = now + timedelta( days = RIGHT_WINDOW) for comp in cal.walk(): try: event_iter = generate_event_iterator(comp, start, end)