Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
tz = get_calendar_timezone(base_resource)
def filter_fn(cls):
return parse_filter(filter_el, cls(tz))
def members(collection):
return itertools.chain(
collection.calendar_query(filter_fn),
collection.subcollections())
async for (href, resource) in webdav.traverse_resource(
base_resource, base_href, depth,
members=members):
# Ideally traverse_resource would only return the right things.
if getattr(resource, 'content_type', None) == 'text/calendar':
propstat = davcommon.get_properties_with_data(
self.data_property, href, resource, properties, environ,
requested)
yield webdav.Status(
href, '200 OK', propstat=[s async for s in propstat])
try:
nresults = int(nresults_el.text)
except ValueError:
raise webdav.BadRequestError(
'nresults not a number')
else:
nresults = None
i = 0
async for (href, resource) in webdav.traverse_resource(
base_resource, base_href, depth):
if not apply_filter(filter_el, resource):
continue
if nresults is not None and i >= nresults:
break
propstat = davcommon.get_properties_with_data(
self.data_property, href, resource, properties, environ,
requested)
yield webdav.Status(
href, '200 OK', propstat=[s async for s in propstat])
i += 1