From 07954626c6925f22e4d59b6d68f0947d4e54b8b9 Mon Sep 17 00:00:00 2001
From: Lukas Fleischer <lfleischer@calcurse.org>
Date: Thu, 11 Feb 2016 18:22:05 +0100
Subject: Support format strings when dumping imported items

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>
---
 contrib/caldav/calcurse-caldav.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'contrib/caldav')

diff --git a/contrib/caldav/calcurse-caldav.py b/contrib/caldav/calcurse-caldav.py
index c569009..1751897 100755
--- a/contrib/caldav/calcurse-caldav.py
+++ b/contrib/caldav/calcurse-caldav.py
@@ -45,7 +45,11 @@ def calcurse_wipe():
 
 
 def calcurse_import(icaldata):
-    p = subprocess.Popen([calcurse, '-i', '-', '--list-imported', '-q'],
+    p = subprocess.Popen([calcurse, '-i', '-', '--dump-imported', '-q',
+                          '--format-recur-apt=%(hash)\\n',
+                          '--format-event=%(hash)\\n',
+                          '--format-recur-event=%(hash)\\n',
+                          '--format-todo=%(hash)\\n'],
                          stdin=subprocess.PIPE, stdout=subprocess.PIPE)
     return p.communicate(icaldata.encode('utf-8'))[0].decode('utf-8').rstrip()
 
-- 
cgit v1.2.3-70-g09d2