You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think a print trace of the problem is worth 1,000 words:
# Case 1
BEGIN:VEVENT
SUMMARY:Recurrence with 2 deleted days
DTSTART;TZID=Europe/Paris:20170502T100000
DTEND;TZID=Europe/Paris:20170502T110000
DTSTAMP:20170504T085344Z
UID:uid-0
EXDATE;TZID=Europe/Paris:20170523T100000
EXDATE;TZID=Europe/Paris:20170516T100000
RRULE:FREQ=WEEKLY;BYDAY=TU
STATUS:CONFIRMED
END:VEVENT
[<icalendar.prop.vDDDLists object at 0x7fe2ed87ef28>, <icalendar.prop.vDDDLists object at 0x7fe2ed87ebe0>]
type(event['EXDATE']) = <class 'list'>
# Case 2
BEGIN:VEVENT
SUMMARY:Recurrence with one deleted day
DTSTART;TZID=Europe/Paris:20170502T023000
DTEND;TZID=Europe/Paris:20170502T033000
DTSTAMP:20170504T085344Z
UID:uid-1
EXDATE;TZID=Europe/Paris:20170509T023000
RRULE:FREQ=WEEKLY;BYDAY=TU
STATUS:CONFIRMED
END:VEVENT
<icalendar.prop.vDDDLists object at 0x7fe2ed4234e0>
type(event['EXDATE']) = <class 'icalendar.prop.vDDDLists'>
As you can see, we can't rely on the type of EXDATE, since it can either be a Python list of vDDDLists or just one vDDDLists instance. In my own application, I had to do this workaround to have a generic way of handling:
exdates = event['EXDATE']
if isinstance(event['EXDATE'], icalendar.prop.vDDDLists):
exdates = [exdates]
Either vDDDLists objects should be merged in a single one (best abstraction API I think), either EXDATE should always return a list of lists. But not both behaviour...
The text was updated successfully, but these errors were encountered:
mlorant
changed the title
EXDATE info type in prop.Event is inconsistent return : can be either list of vDDDLists
EXDATE info type in prop.Event is inconsistent : can be either list of vDDDLists
May 4, 2017
mlorant
changed the title
EXDATE info type in prop.Event is inconsistent : can be either list of vDDDLists
EXDATE info type in prop.Event is inconsistent (can be list of vDDDLists or just one vDDDLists instance)
May 4, 2017
mlorant
changed the title
EXDATE info type in prop.Event is inconsistent (can be list of vDDDLists or just one vDDDLists instance)
EXDATE info type in prop.Event is inconsistent (can be list of vDDDLists or just one object instance)
May 4, 2017
I think a print trace of the problem is worth 1,000 words:
As you can see, we can't rely on the type of EXDATE, since it can either be a Python list of
vDDDLists
or just onevDDDLists
instance. In my own application, I had to do this workaround to have a generic way of handling:Either
vDDDLists
objects should be merged in a single one (best abstraction API I think), either EXDATE should always return a list of lists. But not both behaviour...The text was updated successfully, but these errors were encountered: