How to use the icalendar.cal.Calendar.from_ical function in icalendar

To help you get started, we’ve selected a few icalendar examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jelmer / xandikos / dystros / utils.py View on Github external
if propstatsub.tag == '{DAV:}status':
                if propstatsub.text == 'HTTP/1.1 404 Not Found':
                    raise KeyError(uid)
            elif propstatsub.tag == '{DAV:}prop':
                by_status[status] = propstatsub
            else:
                assert False, 'invalid %r' % propstatsub.tag
        etag = None
        data = None
        for prop in by_status.get('HTTP/1.1 200 OK', []):
            if prop.tag == '{urn:ietf:params:xml:ns:caldav}calendar-data':
                data = prop.text
            if prop.tag == '{DAV:}getetag':
                etag = prop.text
        assert data is not None, "data missing for %r" % href
        return (href, etag, Calendar.from_ical(data))
    raise KeyError(uid)
github jelmer / xandikos / split.py View on Github external
def StripStamps(c):
    if c is None:
        return None
    c = Calendar.from_ical(c.to_ical())
    for sc in c.subcomponents:
        if 'DTSTAMP' in sc:
            del sc['DTSTAMP']
    return c.to_ical()