_text = _text + item.text
return _text
+ @property
+ def color(self):
+ """Color."""
+ try:
+ return "#%s" % self.metadata.get('collection', 'color')
+ except (ConfigParser.NoSectionError, ConfigParser.NoOptionError, ValueError):
+ return None
+
@property
def headers(self):
"""Find headers items in collection."""
"C": "urn:ietf:params:xml:ns:caldav",
"A": "urn:ietf:params:xml:ns:carddav",
"D": "DAV:",
+ "E": "http://apple.com/ns/ical/",
"CS": "http://calendarserver.org/ns/"}
log = logging.getLogger(__name__)
element.text = item.etag
elif tag == _tag("D", "displayname") and is_collection:
element.text = collection.name
+ elif tag == _tag("E", "calendar-color") and is_collection:
+ element.text = collection.color
elif tag == _tag("D", "principal-URL"):
# TODO: use a real principal URL, read rfc3744-4.2 for info
tag = ET.Element(_tag("D", "href"))