$ mkdir -p ~/.config/calypso/calendars/private/test
$ cd ~/.config/calypso/calendars/private/test
$ git init
-$ git commit --allow-empty -m'initialize new calendar'
+$ cat > .calypso-collection << EOF
+[collection]
+is-calendar = 1
+EOF
+$ git add .calypso-collection
+$ git commit -m'initialize new calendar'
The new calendar should now be visible as https://USER:PASSWORD@localhost:5233/private/test.
You can add files to the directory at any time; calypso will check the
directory mtime at each operation and update its internal state from
-that on disk automatically when the directory changes. Importing files
+that on disk automatically when the directory changes.
+
+Importing files
+---------------
Given a set of files with VCALENDAR or VCARD entries, you can import them with:
@property
def length(self):
return "%d" % len(self.text)
+
+ @property
+ def is_addressbook(self):
+ try:
+ return self.metadata.getboolean('collection', 'is-addressbook')
+ except (ConfigParser.NoSectionError, ConfigParser.NoOptionError, ValueError):
+ return True
+
+ @property
+ def is_calendar(self):
+ try:
+ return self.metadata.getboolean('collection', 'is-calendar')
+ except (ConfigParser.NoSectionError, ConfigParser.NoOptionError, ValueError):
+ return True
for tag in props:
element = ET.Element(tag)
if tag == _tag("D", "resourcetype") and is_collection:
- tag = ET.Element(_tag("C", "calendar"))
- element.append(tag)
- tag = ET.Element(_tag("A", "addressbook"))
- element.append(tag)
+ if collection.is_calendar:
+ tag = ET.Element(_tag("C", "calendar"))
+ element.append(tag)
+ if collection.is_addressbook:
+ tag = ET.Element(_tag("A", "addressbook"))
+ element.append(tag)
tag = ET.Element(_tag("D", "collection"))
element.append(tag)
elif tag == _tag("D", "owner"):
# WebDAV properties. Defaults to the collection's path.
description = Collection of all my personal dates.
+# Advertise this collection as a calendar. If this setting is absent,
+# it defaults to True.
+is-calendar = 1
+# Advertise this collection as an address book. Behaves in analogy to
+# is-calendar.
+is-addressbook = 0
+
# vim:ft=cfg