summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorRandy Ramos <rramos1295@gmail.com>2017-11-10 07:37:28 -0500
committerLukas Fleischer <lfleischer@calcurse.org>2017-11-10 16:00:49 +0100
commit9be2c106e62fd4825181454576727591fa2d2b04 (patch)
treeea9c9d6414b3571d4dbfe6732b24071f8aaf680c /contrib
parent5b94be22466c8c6e89f207c66527d9c0b122ce47 (diff)
downloadcalcurse-9be2c106e62fd4825181454576727591fa2d2b04.tar.gz
calcurse-9be2c106e62fd4825181454576727591fa2d2b04.zip
calcurse-caldav: Read password from env variable
Add the option to read the basic authentication password from the CALCURSE_CALDAV_PASSWORD environment variable. 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.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/contrib/caldav/calcurse-caldav.py b/contrib/caldav/calcurse-caldav.py
index 7519af3..4d5e471 100755
--- a/contrib/caldav/calcurse-caldav.py
+++ b/contrib/caldav/calcurse-caldav.py
@@ -508,6 +508,9 @@ authcode = args.authcode
verbose = args.verbose
debug = args.debug
+# Read environment variables
+password = os.getenv('CALCURSE_CALDAV_PASSWORD')
+
# Read configuration.
config = configparser.RawConfigParser()
if verbose:
@@ -563,10 +566,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'))