From b9d80c3cf4b3e7664c988b7d180dd074767f67d8 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sun, 24 Jan 2016 02:22:49 +0100 Subject: calcurse-caldav: Add XML declaration to requests Signed-off-by: Lukas Fleischer --- contrib/caldav/calcurse-caldav.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'contrib') diff --git a/contrib/caldav/calcurse-caldav.py b/contrib/caldav/calcurse-caldav.py index 8afbd4b..262f4ee 100755 --- a/contrib/caldav/calcurse-caldav.py +++ b/contrib/caldav/calcurse-caldav.py @@ -120,16 +120,17 @@ def remote_query(cmd, path, additional_headers, body): def get_hrefmap(conn, uid=None): if uid: - propfilter = '' +\ - '%s' +\ - '' % (uid) + propfilter = '' +\ + '%s' +\ + '' % (uid) else: propfilter = '' - body = '' +\ - '' +\ - '' + propfilter + '' +\ - '' + body = '' +\ + '' +\ + '' +\ + '' + propfilter + '' +\ + '' headers, body = remote_query("REPORT", path, {}, body) if not headers: return {} @@ -250,11 +251,12 @@ def pull_objects(conn, syncdb, hrefmap): orphan = set(syncdb.keys()) - set(hrefmap.keys()) # Download and import new objects from the server. - body = '' +\ - '' + body = '' +\ + '' +\ + '' for etag in missing: - body += '%s' % (hrefmap[etag]) - body += '' + body += '%s' % (hrefmap[etag]) + body += '' headers, body = remote_query("REPORT", path, {}, body) root = etree.fromstring(body) -- cgit v1.2.3