From 25c3648d7536ce37e95329f59e1dcd1afc25c632 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Thu, 14 Jun 2012 16:35:10 +0200 Subject: [PATCH] Add a dummy filter for item tags Related to #53 --- radicale/xmlutils.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index d5277a6e..c2024be3 100644 --- a/radicale/xmlutils.py +++ b/radicale/xmlutils.py @@ -430,8 +430,15 @@ def report(path, xml_request, collection): in root.findall(_tag("D", "href"))) else: hreferences = (path,) + # TODO: handle other filters + # TODO: handle the nested comp-filters correctly + # Read rfc4791-9.7.1 for info + tag_filters = set( + element.get("name") for element + in root.findall(".//%s" % _tag("C", "comp-filter"))) else: hreferences = () + tag_filters = None # Writing answer multistatus = ET.Element(_tag("D", "multistatus")) @@ -454,6 +461,9 @@ def report(path, xml_request, collection): items = collection.components for item in items: + if tag_filters and item.tag not in tag_filters: + continue + response = ET.Element(_tag("D", "response")) multistatus.append(response)