def from_ical(ical): """Parses the data format from ical text format. """ try: ical = unescape_char(ical) return ical.decode(vText.encoding, 'replace') except: raise ValueError, 'Expected ical text, got: %s' % ical
def icalendar_to_python(event_properties): """ Converts all properties in a icalendar event to python objects :param event_properties: A dictionary with ICalendar event properties :return: The same dictionary with all values converted """ converter = TypesFactory() for prop in event_properties: converted_prop = converter.to_ical(prop, event_properties[prop]) event_properties[prop] = unescape_char(converted_prop.decode("utf-8")) return event_properties
def from_ical(cls, ical): ical_unesc = unescape_char(ical) return cls(ical_unesc)
def from_ical(ical, timezone=None): out = unescape_char(ical).split(",") return out