Skip to content

Commit 50cb2de

Browse files
Add calendar-description, addressbook-description to the meta data
When a CalDAV collection has calendar-description set and vdirsyncer synchronizes the “meta” data, synchronize also the calendar description. -- likewise for addressbook-description and calendar-order
1 parent 68ff37e commit 50cb2de

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

CHANGELOG.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ Package maintainers and users who have to manually update their installation
99
may want to subscribe to `GitHub's tag feed
1010
<https://github.com/pimutils/vdirsyncer/tags.atom>`_.
1111

12+
- Add "description" and "order" as metadata. These fetch the CalDAV:
13+
calendar-description, CardDAV:addressbook-description and apple-ns:calendar-order
14+
properties.
15+
1216
Version 0.16.8
1317
==============
1418

docs/config.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,12 @@ Pair Section
116116
- ``metadata``: Metadata keys that should be synchronized when ``vdirsyncer
117117
metasync`` is executed. Example::
118118

119-
metadata = ["color", "displayname"]
119+
metadata = ["color", "displayname", "description", "order"]
120120

121-
This synchronizes the ``color`` and the ``displayname`` properties. The
121+
This synchronizes the ``http://apple.com/ns/ical/:calendar-color``,
122+
``DAV:displayname``, ``CalDAV:calendar-description``,
123+
``CardDAV:addressbook-description`` and
124+
``http://apple.com/ns/ical/:calendar-order`` properties. The
122125
``conflict_resolution`` parameter applies here as well.
123126

124127
.. _storage_config:

docs/vdir.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,11 @@ have any file extensions.
5656
known from CSS, for example) are allowed. The prefixing ``#`` must be
5757
present.
5858

59-
- A file called ``displayname`` contains a UTF-8 encoded label that may be used
60-
to represent the vdir in UIs.
59+
- A file called ``order`` inside the vdir includes the relative order
60+
of the calendar, a property that is only relevant in UI design.
61+
62+
- Files called ``displayname`` and ``description`` contain a UTF-8 encoded label/
63+
description, that may be used to represent the vdir in UIs.
6164

6265
Writing to vdirs
6366
================

vdirsyncer/storage/dav.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,8 @@ class CalDAVStorage(DAVStorage):
728728
_property_table = dict(DAVStorage._property_table)
729729
_property_table.update({
730730
'color': ('calendar-color', 'http://apple.com/ns/ical/'),
731+
'description': ('calendar-description', 'urn:ietf:params:xml:ns:caldav'),
732+
'order': ('calendar-order', 'http://apple.com/ns/ical/'),
731733
})
732734

733735
def __init__(self, start_date=None, end_date=None,
@@ -843,3 +845,8 @@ class CardDAVStorage(DAVStorage):
843845
</C:addressbook-multiget>'''
844846

845847
get_multi_data_query = '{urn:ietf:params:xml:ns:carddav}address-data'
848+
849+
_property_table = dict(DAVStorage._property_table)
850+
_property_table.update({
851+
'description': ('addressbook-description', 'urn:ietf:params:xml:ns:carddav'),
852+
})

0 commit comments

Comments
 (0)