novoid / Memacs

What did I do on February 14th 2007? Visualize your (digital) life in Org-mode
GNU General Public License v3.0
1.03k stars 66 forks source link

memacs_ical handling of events with no DTEND #24

Closed ajft closed 8 years ago

ajft commented 8 years ago

I've just started using memacs_ical to parse my google calendar and found it was crashing on one entry. Investigation found that the offending event has a DTSTART but no DTEND. BEGIN:VEVENT DTSTART:20110822T231000Z DTSTAMP:20151215T013238Z UID:02082011132826501XMTDNW CREATED:20110208T033417Z DESCRIPTION:... LAST-MODIFIED:20110316T051852Z LOCATION: SEQUENCE:0 STATUS:CONFIRMED SUMMARY:... TRANSP:OPAQUE END:VEVENT

memacs_ical.py dumps: Traceback (most recent call last): File "/home/ajft/src/memacs/memacs/lib/memacs.py", line 187, in handle_main self._main() File "/home/ajft/src/memacs/memacs/ical.py", line 173, in _main self.handle_vevent(component) File "/home/ajft/src/memacs/memacs/ical.py", line 131, in __handle_vevent dtend = self.vtext_to_unicode(component.get('DTEND').to_ical()) AttributeError: 'NoneType' object has no attribute 'to_ical' Traceback (most recent call last): File "/usr/lib/python2.7/logging/init.py", line 859, in emit msg = self.format(record) File "/usr/lib/python2.7/logging/init.py", line 732, in format return fmt.format(record) File "/usr/lib/python2.7/logging/init.py", line 474, in format s = self._fmt % record.dict TypeError: not enough arguments for format string Logged from file memacs.py, line 196 Traceback (most recent call last): File "/usr/local/bin/memacs_ical.py", line 28, in memacs.handle_main() File "/home/ajft/src/memacs/memacs/lib/memacs.py", line 187, in handle_main self._main() File "/home/ajft/src/memacs/memacs/ical.py", line 173, in _main self.handle_vevent(component) File "/home/ajft/src/memacs/memacs/ical.py", line 131, in __handle_vevent dtend = self.vtext_to_unicode(component.get('DTEND').to_ical()) AttributeError: 'NoneType' object has no attribute 'to_ical' Makefile:60: recipe for target 'ical_monash.org_archive' failed make: *\ [ical_monash.org_archive] Error 1 (my workaround was to hunt back through my calendar to 2011-Aug-22 and edit the event to give it a duration)

novoid commented 8 years ago

For ical events with no end date/time, I define the end of time with 9999-12-31.

Fixed with 53a6107 - thanks for reporting!