From 474113454b0f99bcd011ce9abb109ee7054ac731 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Hainaud?= Date: Thu, 28 Apr 2011 18:36:33 +0200 Subject: [PATCH] Add support for iCal (closes #252) --- radicale/__init__.py | 3 ++- radicale/xmlutils.py | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/radicale/__init__.py b/radicale/__init__.py index ad1a4db..2c5e28e 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -312,7 +312,8 @@ class CalendarHTTPHandler(server.BaseHTTPRequestHandler): @log_request_content def do_PROPPATCH(self): """Manage PROPPATCH request.""" - self._answer = xmlutils.proppatch() + self._answer = xmlutils.proppatch( + self.path, self._content, self._calendar) self.send_response(client.MULTI_STATUS) self.send_header("DAV", "1, calendar-access") diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index 7e8a399..24ee61a 100644 --- a/radicale/xmlutils.py +++ b/radicale/xmlutils.py @@ -187,10 +187,14 @@ def proppatch(path, xml_request, calendar): """ # Reading request root = ET.fromstring(xml_request) + props = [] - prop_element = root.find(_tag("D", "prop")) - prop_list = prop_element.getchildren() - props = [prop.tag for prop in prop_list] + for action in ("set", "remove"): + action_element = root.find(_tag("D", action)) + if action_element: + prop_element = action_element.find(_tag("D", "prop")) + prop_list = prop_element.getchildren() + props.extend(prop.tag for prop in prop_list) # Writing answer multistatus = ET.Element(_tag("D", "multistatus"))