aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/caldav
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@calcurse.org>2018-08-25 08:53:21 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2018-08-25 08:54:03 +0200
commit8466717f063a3c99297f24851c96a72c095b1739 (patch)
tree7ffb82dac3f8965ac7247a6a5cbaa1cc5a30575e /contrib/caldav
parent41f4a92fa97deb951833b0807c2359518e87ae15 (diff)
downloadcalcurse-8466717f063a3c99297f24851c96a72c095b1739.tar.gz
calcurse-8466717f063a3c99297f24851c96a72c095b1739.zip
calcurse-caldav: print executed commands in debug mode
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'contrib/caldav')
-rwxr-xr-xcontrib/caldav/calcurse-caldav.py41
1 files changed, 36 insertions, 5 deletions
diff --git a/contrib/caldav/calcurse-caldav.py b/contrib/caldav/calcurse-caldav.py
index c880c3e..29ac328 100755
--- a/contrib/caldav/calcurse-caldav.py
+++ b/contrib/caldav/calcurse-caldav.py
@@ -54,7 +54,13 @@ def calcurse_wipe():
print('Removing all local calcurse objects...')
if dry_run:
return
- subprocess.call([calcurse, '-F', '--filter-hash=XXX'])
+
+ command = [calcurse, '-F', '--filter-hash=XXX']
+
+ if debug:
+ print('Running command: {}'.format(command))
+
+ subprocess.call(command)
def calcurse_import(icaldata):
@@ -71,13 +77,25 @@ def calcurse_import(icaldata):
'--format-todo=%(hash)\\n'
]
+ if debug:
+ print('Running command: {}'.format(command))
+
p = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
return p.communicate(icaldata.encode('utf-8'))[0].decode('utf-8').rstrip()
def calcurse_export(objhash):
- p = subprocess.Popen([calcurse, '-x', 'ical', '--export-uid',
- '--filter-hash=' + objhash], stdout=subprocess.PIPE)
+ command = [
+ calcurse,
+ '-x', 'ical',
+ '--export-uid',
+ '--filter-hash=' + objhash
+ ]
+
+ if debug:
+ print('Running command: {}'.format(command))
+
+ p = subprocess.Popen(command, stdout=subprocess.PIPE)
return p.communicate()[0].decode('utf-8').rstrip()
@@ -93,16 +111,29 @@ def calcurse_hashset():
'--format-todo=%(hash)\\n'
]
+ if debug:
+ print('Running command: {}'.format(command))
+
p = subprocess.Popen(command, stdout=subprocess.PIPE)
return set(p.communicate()[0].decode('utf-8').rstrip().splitlines())
def calcurse_remove(objhash):
- subprocess.call([calcurse, '-F', '--filter-hash=!' + objhash])
+ command = [calcurse, '-F', '--filter-hash=!' + objhash]
+
+ if debug:
+ print('Running command: {}'.format(command))
+
+ subprocess.call(command)
def calcurse_version():
- p = subprocess.Popen([calcurse, '--version'], stdout=subprocess.PIPE)
+ command = [calcurse, '--version']
+
+ if debug:
+ print('Running command: {}'.format(command))
+
+ p = subprocess.Popen(command, stdout=subprocess.PIPE)
m = re.match(r'calcurse ([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9]+)-)?',
p.communicate()[0].decode('utf-8'))
if not m: