Changeset View
Changeset View
Standalone View
Standalone View
pykolab/xml/event.py
Show First 20 Lines • Show All 345 Lines • ▼ Show 20 Lines | def from_ical(self, ical, raw=None): | ||||
# to fail substitution. | # to fail substitution. | ||||
for attr in list(set(ical_event.required)): | for attr in list(set(ical_event.required)): | ||||
if ical_event.has_key(attr): | if ical_event.has_key(attr): | ||||
self.set_from_ical(attr.lower(), ical_event[attr]) | self.set_from_ical(attr.lower(), ical_event[attr]) | ||||
# NOTE: Make sure to list(set()) or duplicates may arise | # NOTE: Make sure to list(set()) or duplicates may arise | ||||
for attr in list(set(ical_event.singletons)): | for attr in list(set(ical_event.singletons)): | ||||
if ical_event.has_key(attr): | if ical_event.has_key(attr): | ||||
if isinstance(ical_event[attr], list): | |||||
ical_event[attr] = ical_event[attr][0]; | |||||
self.set_from_ical(attr.lower(), ical_event[attr]) | self.set_from_ical(attr.lower(), ical_event[attr]) | ||||
# NOTE: Make sure to list(set()) or duplicates may arise | # NOTE: Make sure to list(set()) or duplicates may arise | ||||
for attr in list(set(ical_event.multiple)): | for attr in list(set(ical_event.multiple)): | ||||
if ical_event.has_key(attr): | if ical_event.has_key(attr): | ||||
self.set_from_ical(attr.lower(), ical_event[attr]) | self.set_from_ical(attr.lower(), ical_event[attr]) | ||||
def _xml_from_ical(self, ical): | def _xml_from_ical(self, ical): | ||||
▲ Show 20 Lines • Show All 1,097 Lines • Show Last 20 Lines |