Skip to main content

Module vdir

Module vdir 

Source
Expand description

Address books and calendars on disk, as vdir: one folder per collection, one file per contact (.vcf) or per event (.ics), the collection’s name and colour in the files displayname and color. pimsync, vdirsyncer, khal and khard read the same folders (https://vdirsyncer.pimutils.org/en/stable/vdir.html).

What sync needs to remember, where each file sits on the server and its ETag, lives apart in the state folder: the data folders hold only your contacts and events.

Structs§

Collection
One address book or calendar.
ItemState
One item, as last agreed with the server.
State
What sync knows of a collection: where it is, how far it got, and each item.

Enums§

Kind

Constants§

LOCAL
The account of collections kept on this computer only.
OFF 🔒
The mark of an account switched off, in its folder of each kind.

Functions§

collections
Every collection of a kind, from every account, by account then name.
content_hash
A short hash of a file’s content, to tell whether it changed since sync.
create
A new collection made here: its folder, its name and colour, and a state that asks the next sync to create it on the server (MKCALENDAR or an extended MKCOL). components says what a calendar holds (“VTODO” for a task list). Returns it; an id already taken gets a number.
delete_collection
An empty collection deleted: at once when it was never sent, else hidden until the next sync deletes it on the server. One holding anything stays.
every_collection
Every collection kept here, those deleted and not yet gone from the server included.
folder_id
“personal”, “contacts”, “Calendrier%20perso” → a folder name that holds on every system: letters, digits, - and _, the rest as _.
holds_items
The items a collection holds here: events, tasks or contacts.
new_name
A new item’s name: unique, and safe as a file name and in a URL.
one_folder 🔒
Whether a name (an account’s, a collection’s) is one folder of its own: not “.”, “..”, nor a path (“../x”, “C:”), which would put files elsewhere.
prepare
A collection’s folder, made if needed, with its name and colour written for other tools.
rename_collection
A collection renamed here; the next sync tells the server.
set_account_off
An account’s calendars and address books out of the pages (off), or back.
state_path
Where sync keeps what it knows of a collection.
write_item
Writes an item next to its place, then moves it in.