summaryrefslogtreecommitdiff
path: root/contrib
AgeCommit message (Collapse)Author
2016-12-15calcurse-caldav: Use right diffs when synchronizingLukas Fleischer
Some parameters where swapped accidentally when reworking the diff computation in c8d3d87 (calcurse-caldav: Compute diffs before synchronizing, 2016-12-13) such that the synchronization functions were working with incorrect diffs since that commit. Exchange the parameters again to fix this. Reported-by: Guillaume Laurès <guillaume@lauresfamily.fr> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-12-13calcurse-caldav: Fix scrambled commentLukas Fleischer
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-12-13calcurse-caldav: Compute diffs before synchronizingLukas Fleischer
Instead of computing the objects to push/pull on-demand, use a snapshot of the synchronization database taken before the synchronization process starts. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-12-08calcurse-caldav: Fix appointment importsLukas Fleischer
When importing an appointment from the server, make sure we store a hash of the item in the sync DB, and not the serialized item itself. Reported-by: Guillaume Laurès <guillaume@lauresfamily.fr> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-12-08calcurse-caldav: Add debug output for sync DB operationsLukas Fleischer
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-12-08calcurse-caldav: Avoid empty multigetLukas Fleischer
When there are no new objects to pull from the server, skip the import routine instead of sending a query that requests zero items. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-12-08calcurse-caldav: Split object addition and removalLukas Fleischer
Instead of performing two synchronization steps (push/pull), split the synchronization protocol into four steps: 1. Retrieve new objects from the server. 2. Delete local objects that no longer exist on the server. 3. Push new objects to the server. 4. Delete remote objects that no longer exist locally. Each of the steps is performed by a separate function. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-06-18calcurse-caldav: Encode the request body in UTF-8Lukas Fleischer
When a string is passed to HTTPConnection.request(), it is automatically ISO 8859-1 encoded. Therefore, since we already specify UTF-8 as character set in the headers, we need to UTF-8 encode the request body manually. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-04-01Document the hooks featureLukas Fleischer
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-02-11Support format strings when dumping imported itemsLukas Fleischer
In commit 3eae7ce (Add --list-imported command line option, 2016-01-12), we added an option to print the hashes of imported items to stdout. Extend this command line option such that it dumps the items using the specified formatting strings. With the new behavior it is, for example, easier to check items for import errors. Also, rename the option from --list-imported to --dump-imported (it is not part of any official release yet so we do not need to care about backwards compatibility). Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-02-09Install calcurse-caldav by defaultLukas Fleischer
Add a new Makefile to build and install calcurse-caldav and include it in the top-level build process. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-02-08Improve example hooksLukas Fleischer
The post-save and post-sync hooks now automatically detect whether the data directory contains a .git/ directory and skip the commit creation process if it does not. The post-save hook and the new pre-load hook now also run calcurse-caldav in the background if that script is available and the data directory contains a caldav/ directory. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-02-07Do not put all files under version control in example hooksLukas Fleischer
Modify the Git hooks such they only add known data files to the index. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-02-07calcurse-caldav: Add hook supportLukas Fleischer
Introduce pre-sync and post-sync hooks which need to be located under ~/.calcurse/caldav/hooks/ and are executed before/after synchronization with a CalDAV server. Also, add an example post-sync hook and change the example post-save hook such that it does not create tiny commits during synchronization. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-02-07Fix file name of the example hookLukas Fleischer
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-02-07Move example hook to contrib/hooks/Lukas Fleischer
The contrib/ directory now contains another script that is not directly related to hooks. Clean things up by placing example hooks in a separate subdirectory. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-02-05calcurse-caldav: Use -G and %(hash) to list hashesLukas Fleischer
Instead of reimplementing the code to generate object hashes in the synchronization script, use format strings to print the hashes in grep mode. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-02-02calcurse-caldav: Reword dry-run warningLukas Fleischer
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-02-01calcurse-caldav: Modernize format stringsLukas Fleischer
Replace %-style string formatting with format(). Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-02-01calcurse-caldav: Make synchronization more robustLukas Fleischer
In addition to storing ETag-hash tuples in the synchronization database, also store the URI of each object. This makes the synchronization process a bit more robust as we do not need to depend on ETags being globally unique. It also allows us to detect conflicts which occur when an object is modified locally and on the server at the same time. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-02-01calcurse-caldav: Fix issues reported by pylintLukas Fleischer
Add missing parameter to remote_query() and fix various style issues. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-28calcurse-caldav: Fix version checkLukas Fleischer
Since commit 41389ab (args.c: Revise help/usage/version output, 2016-01-28), the version string starts with "calcurse" (lowercase). Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-26calcurse-caldav: Use calendar-multiget to obtain ETagLukas Fleischer
Some CalDAV servers do not support calendar-query with a UID filter. Use a calendar-multiget request to obtain the ETag of submitted objects instead. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-26calcurse-caldav: Fix property filterLukas Fleischer
Fix a TypeError that occurred during string formatting by putting parentheses around the multi-line string. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-25calcurse-caldav: Handle missing ETag gracefullyLukas Fleischer
This was partly fixed by 475c341 (calcurse-caldav: Fix late retrieval of ETag, 2016-01-25). However, the case where the server does not return ETag after creating a new item still wasn't handled properly. This patch hopefully addresses this and also makes sure that the ETag header is matched case-insensitively. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-25calcurse-caldav: Improve version checkLukas Fleischer
Make sure that at least a current Git build of calcurse is used. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-25calcurse-caldav: Print XML dump in debug mode onlyLukas Fleischer
In die_atnode(), we currently print a full dump of the XML node if verbose mode is enabled. Change this behavior such that a dump is only created in debug mode. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-25contrib/caldav/README: Minor improvementsLukas Fleischer
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-25calcurse-caldav: Fix comment on certificate checksLukas Fleischer
Clarify that ssl._create_unverified_context() was added in Python 3.4.3. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-25calcurse-caldav: Support custom HTTP headersLukas Fleischer
Add support for specifying additional HTTP headers, such as the User-Agent, in the configuration file. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-25calcurse-caldav: Fix late retrieval of ETagLukas Fleischer
Fixes another regression introduced in badbd71 (calcurse-caldav: Add a debug mode, 2016-01-23). Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-25calcurse-caldav: Fix --init=keep-localLukas Fleischer
Fixes a regression introduced in badbd71 (calcurse-caldav: Add a debug mode, 2016-01-23). Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-25calcurse-caldav: Fix duplicate Content-Type prefixLukas Fleischer
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-25calcurse-caldav: Fix MIME type in requestsLukas Fleischer
Specify application/xml in the Content-Type of requests except for PUT, where we actually submit calendar data. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-24calcurse-caldav: Show debug output before checking statusLukas Fleischer
Make sure we print the headers and the body of a HTTP response in debug mode, even if the HTTP status code indicates failure. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-24calcurse-caldav: Add XML declaration to requestsLukas Fleischer
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-23calcurse-caldav: Prefix error messages with "error:"Lukas Fleischer
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-23calcurse-caldav: Check response statusLukas Fleischer
Bail out if the HTTP status code of any of the replies starts with a digit other than 2. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-23calcurse-caldav: Include command/path in the debug outputLukas Fleischer
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-23calcurse-caldav: Ensure path always starts/ends with a slashLukas Fleischer
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-23calcurse-caldav: Add a debug modeLukas Fleischer
Dump all communication with the server to stdout if --debug is specified. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-23calcurse-caldav: Fix parsing of the Verbose config optionLukas Fleischer
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-23calcurse-caldav: Make InsecureSSL optionalLukas Fleischer
2016-01-23calcurse-caldav: Add a workaround for Python <3.4Lukas Fleischer
Python versions prior to 3.4 do not check certificates by default and thus do not support ssl._create_unverified_context(). Add a workaround. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-22Add a script to synchronize with CalDAV serversLukas Fleischer
Introduce calcurse-caldav, a Python script that can be used to synchronize calcurse instances with CalDAV servers. The script was tested with an instance of the Radicale CalDAV server but it is still alpha software. Make backups before giving it a try! Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
2016-01-07Add an example post-save hookLukas Fleischer
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>