Add color support

You can change the default color by changing the props (.props file for
the filesystem storage backend).
This commit is contained in:
Jochen Sprickerhof
2013-08-17 12:08:40 +02:00
parent d38c4d1c1d
commit 5f2245c35f
2 changed files with 12 additions and 0 deletions

View File

@ -434,6 +434,14 @@ class Collection(object):
with self.props as props:
return props.get("D:displayname", self.path.split(os.path.sep)[-1])
@property
def color(self):
"""Collection color."""
with self.props as props:
if "A:calendar-color" not in props:
props["A:calendar-color"] = "#5ba209"
return props["A:calendar-color"]
@property
def headers(self):
"""Find headers items in collection."""