Skip to content

Commit 342cb86

Browse files
author
Hugo Osvaldo Barrera
committed
Merge remote-tracking branch 'dilyanpalauzov/meta_description'
2 parents e1c9797 + 0231f39 commit 342cb86

File tree

4 files changed

+29
-5
lines changed

4 files changed

+29
-5
lines changed

CHANGELOG.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ Note: Version 0.17 has some alpha releases but ultimately was never finalised.
2222
- Python 3.9 is now supported.
2323
- Our Debian/Ubuntu build scripts have been updated. New versions should be
2424
pushed to those repositories soon.
25+
- Add "description" and "order" as metadata. These fetch the CalDAV:
26+
calendar-description, CardDAV:addressbook-description and apple-ns:calendar-order
27+
properties.
2528

2629
Version 0.16.8
2730
==============

docs/config.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,16 @@ 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
122-
``conflict_resolution`` parameter applies here as well.
121+
This synchronizes the following properties:
122+
123+
- color: ``http://apple.com/ns/ical/:calendar-color``
124+
- displayname: ``DAV:displayname``
125+
- description: ``CalDAV:calendar-description`` and ``CardDAV:addressbook-description``
126+
- order: ``http://apple.com/ns/ical/:calendar-order``
127+
128+
The ``conflict_resolution`` parameter applies for these properties too.
123129

124130
.. _storage_config:
125131

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

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

vdirsyncer/storage/dav.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,8 @@ class CalDAVStorage(DAVStorage):
719719
_property_table.update(
720720
{
721721
"color": ("calendar-color", "http://apple.com/ns/ical/"),
722+
"description": ("calendar-description", "urn:ietf:params:xml:ns:caldav"),
723+
"order": ("calendar-order", "http://apple.com/ns/ical/"),
722724
}
723725
)
724726

@@ -835,3 +837,13 @@ class CardDAVStorage(DAVStorage):
835837
</C:addressbook-multiget>"""
836838

837839
get_multi_data_query = "{urn:ietf:params:xml:ns:carddav}address-data"
840+
841+
_property_table = dict(DAVStorage._property_table)
842+
_property_table.update(
843+
{
844+
"description": (
845+
"addressbook-description",
846+
"urn:ietf:params:xml:ns:carddav",
847+
),
848+
}
849+
)

0 commit comments

Comments
 (0)