From 50cb2def73d6ed45bf0fc1ed1c8bdaf2344adb7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B8=D0=BB=D1=8F=D0=BD=20=D0=9F=D0=B0=D0=BB=D0=B0?= =?UTF-8?q?=D1=83=D0=B7=D0=BE=D0=B2?= Date: Sat, 27 Jun 2020 17:00:08 +0000 Subject: [PATCH 1/3] Add calendar-description, addressbook-description to the meta data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- CHANGELOG.rst | 4 ++++ docs/config.rst | 7 +++++-- docs/vdir.rst | 7 +++++-- vdirsyncer/storage/dav.py | 7 +++++++ 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 24419ca..42541e6 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -9,6 +9,10 @@ Package maintainers and users who have to manually update their installation may want to subscribe to `GitHub's tag feed `_. +- Add "description" and "order" as metadata. These fetch the CalDAV: + calendar-description, CardDAV:addressbook-description and apple-ns:calendar-order + properties. + Version 0.16.8 ============== diff --git a/docs/config.rst b/docs/config.rst index 425f740..9d68d54 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -116,9 +116,12 @@ Pair Section - ``metadata``: Metadata keys that should be synchronized when ``vdirsyncer metasync`` is executed. Example:: - metadata = ["color", "displayname"] + metadata = ["color", "displayname", "description", "order"] - This synchronizes the ``color`` and the ``displayname`` properties. The + This synchronizes the ``http://apple.com/ns/ical/:calendar-color``, + ``DAV:displayname``, ``CalDAV:calendar-description``, + ``CardDAV:addressbook-description`` and + ``http://apple.com/ns/ical/:calendar-order`` properties. The ``conflict_resolution`` parameter applies here as well. .. _storage_config: diff --git a/docs/vdir.rst b/docs/vdir.rst index 37223ef..942bfe9 100644 --- a/docs/vdir.rst +++ b/docs/vdir.rst @@ -56,8 +56,11 @@ have any file extensions. known from CSS, for example) are allowed. The prefixing ``#`` must be present. -- A file called ``displayname`` contains a UTF-8 encoded label that may be used - to represent the vdir in UIs. +- A file called ``order`` inside the vdir includes the relative order + of the calendar, a property that is only relevant in UI design. + +- Files called ``displayname`` and ``description`` contain a UTF-8 encoded label/ + description, that may be used to represent the vdir in UIs. Writing to vdirs ================ diff --git a/vdirsyncer/storage/dav.py b/vdirsyncer/storage/dav.py index a7e2422..12bee83 100644 --- a/vdirsyncer/storage/dav.py +++ b/vdirsyncer/storage/dav.py @@ -728,6 +728,8 @@ class CalDAVStorage(DAVStorage): _property_table = dict(DAVStorage._property_table) _property_table.update({ 'color': ('calendar-color', 'http://apple.com/ns/ical/'), + 'description': ('calendar-description', 'urn:ietf:params:xml:ns:caldav'), + 'order': ('calendar-order', 'http://apple.com/ns/ical/'), }) def __init__(self, start_date=None, end_date=None, @@ -843,3 +845,8 @@ class CardDAVStorage(DAVStorage): ''' get_multi_data_query = '{urn:ietf:params:xml:ns:carddav}address-data' + + _property_table = dict(DAVStorage._property_table) + _property_table.update({ + 'description': ('addressbook-description', 'urn:ietf:params:xml:ns:carddav'), + }) From d1b148c9197888d528bc044a48f13187b7c3d551 Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Sun, 13 Jun 2021 00:49:27 +0200 Subject: [PATCH 2/3] Improve docs for new meta properties --- docs/config.rst | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/config.rst b/docs/config.rst index b414ea5..f6a6556 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -118,11 +118,14 @@ Pair Section metadata = ["color", "displayname", "description", "order"] - This synchronizes the ``http://apple.com/ns/ical/:calendar-color``, - ``DAV:displayname``, ``CalDAV:calendar-description``, - ``CardDAV:addressbook-description`` and - ``http://apple.com/ns/ical/:calendar-order`` properties. The - ``conflict_resolution`` parameter applies here as well. + This synchronizes the following properties: + + - color: ``http://apple.com/ns/ical/:calendar-color`` + - displayname: ``DAV:displayname`` + - description: ``CalDAV:calendar-description`` and ``CardDAV:addressbook-description`` + - order: ``http://apple.com/ns/ical/:calendar-order`` + + The ``conflict_resolution`` parameter applies for these properties too. .. _storage_config: From 0231f3999e518e6d85b8b644e66fec0e38bbf642 Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Sun, 13 Jun 2021 00:52:39 +0200 Subject: [PATCH 3/3] `order` is probably less important than the others --- docs/vdir.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/vdir.rst b/docs/vdir.rst index c487ba6..a257310 100644 --- a/docs/vdir.rst +++ b/docs/vdir.rst @@ -56,12 +56,12 @@ have any file extensions. known from CSS, for example) are allowed. The prefixing ``#`` must be present. -- A file called ``order`` inside the vdir includes the relative order - of the calendar, a property that is only relevant in UI design. - - Files called ``displayname`` and ``description`` contain a UTF-8 encoded label/ description, that may be used to represent the vdir in UIs. +- A file called ``order`` inside the vdir includes the relative order + of the calendar, a property that is only relevant in UI design. + Writing to vdirs ================