From 20b1a291496cf41b014cd47a22c27b45f762d1b7 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 11 Nov 2014 21:26:29 +0100 Subject: [PATCH] fix color support 5f2245c35fae introduced an additional alias for the http://apple.com/ns/ical namespace. this can cause problems. --- radicale/ical.py | 6 +++--- radicale/xmlutils.py | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/radicale/ical.py b/radicale/ical.py index a9db439..43a2f9e 100644 --- a/radicale/ical.py +++ b/radicale/ical.py @@ -455,9 +455,9 @@ class Collection(object): def color(self): """Collection color.""" with self.props as props: - if "A:calendar-color" not in props: - props["A:calendar-color"] = "#%x" % randint(0, 255 ** 3 - 1) - return props["A:calendar-color"] + if "ICAL:calendar-color" not in props: + props["ICAL:calendar-color"] = "#%x" % randint(0, 255 ** 3 - 1) + return props["ICAL:calendar-color"] @property def headers(self): diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index f5370fe..6736b6c 100644 --- a/radicale/xmlutils.py +++ b/radicale/xmlutils.py @@ -49,7 +49,6 @@ from . import client, config, ical NAMESPACES = { - "A": "http://apple.com/ns/ical/", "C": "urn:ietf:params:xml:ns:caldav", "CR": "urn:ietf:params:xml:ns:carddav", "D": "DAV:", @@ -228,7 +227,7 @@ def propfind(path, xml_request, collections, user=None): _tag("D", "displayname"), _tag("D", "owner"), _tag("D", "getetag"), - _tag("A", "calendar-color"), + _tag("ICAL", "calendar-color"), _tag("CS", "getctag")] # Writing answer @@ -343,7 +342,7 @@ def _propfind_response(path, item, props, user): item.tag, item.headers, item.timezones) elif tag == _tag("D", "displayname"): element.text = item.name - elif tag == _tag("A", "calendar-color"): + elif tag == _tag("ICAL", "calendar-color"): element.text = item.color else: human_tag = _tag_from_clark(tag)