Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
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()