fix color support
5f2245c35f
introduced an additional alias for the
http://apple.com/ns/ical namespace. this can cause problems.
This commit is contained in:
parent
063f7de7a2
commit
20b1a29149
@ -455,9 +455,9 @@ class Collection(object):
|
|||||||
def color(self):
|
def color(self):
|
||||||
"""Collection color."""
|
"""Collection color."""
|
||||||
with self.props as props:
|
with self.props as props:
|
||||||
if "A:calendar-color" not in props:
|
if "ICAL:calendar-color" not in props:
|
||||||
props["A:calendar-color"] = "#%x" % randint(0, 255 ** 3 - 1)
|
props["ICAL:calendar-color"] = "#%x" % randint(0, 255 ** 3 - 1)
|
||||||
return props["A:calendar-color"]
|
return props["ICAL:calendar-color"]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def headers(self):
|
def headers(self):
|
||||||
|
@ -49,7 +49,6 @@ from . import client, config, ical
|
|||||||
|
|
||||||
|
|
||||||
NAMESPACES = {
|
NAMESPACES = {
|
||||||
"A": "http://apple.com/ns/ical/",
|
|
||||||
"C": "urn:ietf:params:xml:ns:caldav",
|
"C": "urn:ietf:params:xml:ns:caldav",
|
||||||
"CR": "urn:ietf:params:xml:ns:carddav",
|
"CR": "urn:ietf:params:xml:ns:carddav",
|
||||||
"D": "DAV:",
|
"D": "DAV:",
|
||||||
@ -228,7 +227,7 @@ def propfind(path, xml_request, collections, user=None):
|
|||||||
_tag("D", "displayname"),
|
_tag("D", "displayname"),
|
||||||
_tag("D", "owner"),
|
_tag("D", "owner"),
|
||||||
_tag("D", "getetag"),
|
_tag("D", "getetag"),
|
||||||
_tag("A", "calendar-color"),
|
_tag("ICAL", "calendar-color"),
|
||||||
_tag("CS", "getctag")]
|
_tag("CS", "getctag")]
|
||||||
|
|
||||||
# Writing answer
|
# Writing answer
|
||||||
@ -343,7 +342,7 @@ def _propfind_response(path, item, props, user):
|
|||||||
item.tag, item.headers, item.timezones)
|
item.tag, item.headers, item.timezones)
|
||||||
elif tag == _tag("D", "displayname"):
|
elif tag == _tag("D", "displayname"):
|
||||||
element.text = item.name
|
element.text = item.name
|
||||||
elif tag == _tag("A", "calendar-color"):
|
elif tag == _tag("ICAL", "calendar-color"):
|
||||||
element.text = item.color
|
element.text = item.color
|
||||||
else:
|
else:
|
||||||
human_tag = _tag_from_clark(tag)
|
human_tag = _tag_from_clark(tag)
|
||||||
|
Loading…
Reference in New Issue
Block a user