From: W. Trevor King Date: Sun, 30 Jun 2013 19:03:03 +0000 (-0400) Subject: entry: Die unless we're parsing a version 2.0 iCalendar X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7b1c6e0a9d7966522328770cb4ed7464b9c6a5a1;p=pycalendar.git entry: Die unless we're parsing a version 2.0 iCalendar RFC 5545, section 3.7.4 (Version) describes this text field. Until I actually see something using using the (minver ";" maxver) syntax, I'll just require everything to be version 2.0. --- diff --git a/pycalendar/entry.py b/pycalendar/entry.py index 4e5db9f..46bf3b6 100644 --- a/pycalendar/entry.py +++ b/pycalendar/entry.py @@ -146,6 +146,11 @@ class Entry (dict): self._add_value(key=value, value=child, force_list=True) child_lines = [] elif not stack: # our own data, not a child's + if key == 'VERSION': + v = _text.unescape(value) + if v != '2.0': + raise NotImplementedError( + 'cannot parse VERSION {} feed'.format(v)) self._add_value(key=key, value=value) def _add_value(self, key, value, force_list=False):