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 554f317..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) @@ -158,7 +160,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 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"