aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorRandy Ramos <rramos1295@gmail.com>2017-09-30 00:53:13 -0400
committerLukas Fleischer <lfleischer@calcurse.org>2017-10-19 06:26:31 +0200
commitefd76a0d995292e48f5466fccada4901618f7d97 (patch)
tree9b3d020d0bc1c829c934394805d84361cb945cf5 /contrib
parent164d6efcb7a17de6f1a90ea907fc8924bb3493e3 (diff)
downloadcalcurse-efd76a0d995292e48f5466fccada4901618f7d97.tar.gz
calcurse-efd76a0d995292e48f5466fccada4901618f7d97.zip
calcurse-caldav: Add --password command line argument
The "--password" argument overrides the corresponding option in the config file. Signed-off-by: Randy Ramos <rramos1295@gmail.com> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/caldav/calcurse-caldav.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/contrib/caldav/calcurse-caldav.py b/contrib/caldav/calcurse-caldav.py
index 219ce34..173a0a9 100755
--- a/contrib/caldav/calcurse-caldav.py
+++ b/contrib/caldav/calcurse-caldav.py
@@ -470,6 +470,9 @@ parser.add_argument('--syncdb', action='store', dest='syncdbfn',
parser.add_argument('--hookdir', action='store', dest='hookdir',
default=hookdir,
help='path to the calcurse-caldav hooks directory')
+parser.add_argument('--password', action='store', dest='password',
+ default=None,
+ help='password for basic authentication')
parser.add_argument('--authcode', action='store', dest='authcode',
default=None,
help='auth code for OAuth2 authentication')
@@ -485,6 +488,7 @@ configfn = args.configfn
lockfn = args.lockfn
syncdbfn = args.syncdbfn
hookdir = args.hookdir
+password = args.password
authcode = args.authcode
verbose = args.verbose
debug = args.debug
@@ -534,10 +538,8 @@ if config.has_option('Auth', 'UserName'):
else:
username = None
-if config.has_option('Auth', 'Password'):
+if config.has_option('Auth', 'Password') and not password:
password = config.get('Auth', 'Password')
-else:
- password = None
if config.has_section('CustomHeaders'):
custom_headers = dict(config.items('CustomHeaders'))