From 69e2eb09082fbb885d4fcd839eaad892d061f875 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Fri, 10 May 2013 14:56:17 +0200 Subject: [PATCH] Store the supported-calendar-component-set property in the calendar properties --- radicale/xmlutils.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index fbe5855..54c0ada 100644 --- a/radicale/xmlutils.py +++ b/radicale/xmlutils.py @@ -155,6 +155,11 @@ def props_from_request(root, actions=("set", "remove")): result["resourcetype"] = \ "V%s" % resource_type.tag.upper() break + elif prop.tag == "supported-calendar-component-set": + result[_tag_from_clark(prop.tag)] = ",".join( + supported_comp.attrib["name"] + for supported_comp in prop + if supported_comp.tag == "comp") return result @@ -264,7 +269,12 @@ def _propfind_response(path, item, props, user): elif tag == _tag("C", "supported-calendar-component-set"): # This is not a Todo # pylint: disable=W0511 - for component in ("VTODO", "VEVENT", "VJOURNAL"): + human_tag = _tag_from_clark(tag) + if human_tag in collection_props: + components = collection_props[human_tag].split(",") + else: + components = ("VTODO", "VEVENT", "VJOURNAL") + for component in components: comp = ET.Element(_tag("C", "comp")) comp.set("name", component) element.append(comp)