self.scan_dir(False)
return self.my_items
+ def get_color(self):
+ """Color."""
+ try:
+ return "#%s" % self.metadata.get('collection', 'color')
+ except (ConfigParser.NoSectionError, ConfigParser.NoOptionError, ValueError):
+ return None
+
@property
def last_modified(self):
"""Get the last time the collection has been modified.
"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 = item.get_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"))