Fix bug with multiline values

The URL that showed this error up was

https://mozorg.cdn.mozilla.net/media/caldata/GermanHolidays.ics

with the following entry:

BEGIN:VEVENT
CREATED:20061023T132503Z
LAST-MODIFIED:20101214T141313Z
DTSTAMP:20101214T141313Z
UID:917544590
SUMMARY:Heilige drei Könige
STATUS:CONFIRMED
RRULE:FREQ=YEARLY;BYMONTH=1
CATEGORIES:Feiertag
DTSTART;VALUE=DATE:20060106
DTEND;VALUE=DATE:20060107
DESCRIPTION:Christlicher Feiertag. Nur in Baden-Württemberg\, Bayern und
 Sachsen-Anhalt.
X-MOZ-GENERATION:1
END:VEVENT
This commit is contained in:
Markus Unterwaditzer 2014-05-01 11:07:09 +02:00
parent 24a913988b
commit 969ebb653d
2 changed files with 3 additions and 1 deletions

View file

@ -24,6 +24,7 @@ class TestHttpStorage(object):
(u'BEGIN:VEVENT\n'
u'SUMMARY:Eine zweite Kurzinfo\n'
u'DESCRIPTION:Beschreibung des anderen Termines\n'
u' With an extra line for description\n'
u'BEGIN:VALARM\n'
u'ACTION:AUDIO\n'
u'TRIGGER:19980403T120000\n'

View file

@ -20,7 +20,8 @@ def split_collection(text):
collection_type = None
item_type = None
for line in text.splitlines():
if not line.strip():
if u':' not in line:
item.append(line)
continue
key, value = (x.strip() for x in line.split(u':', 1))
if key == u'BEGIN':