From 4fc623bf1d4c13ea5df9c4fbee87da48f32795dc Mon Sep 17 00:00:00 2001 From: dlichtistw Date: Sat, 8 Sep 2018 12:51:11 +0200 Subject: [PATCH 1/3] Fix all_day recognition Fix type check for all_day flag. --- icalevents/icalparser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/icalevents/icalparser.py b/icalevents/icalparser.py index 554f317..cdb8c11 100644 --- a/icalevents/icalparser.py +++ b/icalevents/icalparser.py @@ -158,7 +158,7 @@ def create_event(component): event.end = event_end event.summary = str(component.get('summary')) event.description = str(component.get('description')) - event.all_day = type(component.get('dtstart').dt) is datetime.date + event.all_day = type(component.get('dtstart').dt) is date return event From 8572fafa15eb3fff4a1ae1971205d98f0a910bc4 Mon Sep 17 00:00:00 2001 From: dlichtistw Date: Wed, 12 Sep 2018 06:53:27 +0200 Subject: [PATCH 2/3] Description on recurring events Copy description when creating repeated copies of recurring event. --- .gitignore | 1 + icalevents/icalparser.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 5700e95..ee5b45a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ calendars.txt .coverage dist/* MANIFEST +icalevents.egg-info/* diff --git a/icalevents/icalparser.py b/icalevents/icalparser.py index cdb8c11..f75edde 100644 --- a/icalevents/icalparser.py +++ b/icalevents/icalparser.py @@ -33,6 +33,7 @@ def __init__(self): """ self.uid = -1 self.summary = None + self.description = None self.start = None self.end = None self.all_day = True @@ -103,6 +104,7 @@ def copy_to(self, new_start=None, uid=None): ne = Event() ne.summary = self.summary + ne.description = self.description ne.start = new_start ne.end = (new_start + duration) ne.all_day = (self.all_day and (new_start - self.start).seconds == 0) From c635996cc24db177a2127de1b21be531a8192feb Mon Sep 17 00:00:00 2001 From: dlichtistw Date: Wed, 12 Sep 2018 19:58:48 +0200 Subject: [PATCH 3/3] Fix unittest Reflect all-day event in test data. --- test/test_icalevents.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_icalevents.py b/test/test_icalevents.py index 7aae018..34bd424 100644 --- a/test/test_icalevents.py +++ b/test/test_icalevents.py @@ -40,7 +40,7 @@ def test_event_attributes(self): self.assertEqual(ev.summary, "graue Restmülltonne") self.assertEqual(ev.description, "graue Restmülltonne nicht vergessen!") - self.assertFalse(ev.all_day) + self.assertTrue(ev.all_day) def test_events_async_url(self): url = "https://raw.githubusercontent.com/irgangla/icalevents/master/test/test_data/basic.ics"