summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaximilian Kapra <maximilian@kapra.de>2019-08-11 12:16:07 +0200
committerMaximilian Kapra <maximilian@kapra.de>2019-08-11 12:16:07 +0200
commitf34a3494d27b434b3c8b4ac5d0beaa507b0bfcb0 (patch)
treed0c964a55a4f573bd94ce9e483963e64817c9626
parentc3112f7821fb01bffc7ff2e53dea9637ad7fbeb2 (diff)
downloadcalendar-cli-f34a3494d27b434b3c8b4ac5d0beaa507b0bfcb0.zip
Adding getpass module. Password not echoing to terminal anymore.
-rwxr-xr-xcalendar-cli.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/calendar-cli.py b/calendar-cli.py
index ed7a95e..aa15483 100755
--- a/calendar-cli.py
+++ b/calendar-cli.py
@@ -34,6 +34,7 @@ import logging
import sys
import re
import urllib3
+from getpass import getpass
__version__ = "0.11.0.dev0"
__author__ = "Tobias Brox"
@@ -238,8 +239,14 @@ def interactive_config(args, config, remaining_argv):
config[section] = {}
for config_key in ('caldav_url', 'caldav_user', 'caldav_pass', 'caldav_proxy', 'ssl_verify_cert', 'language', 'timezone', 'inherits'):
- print("Config option %s - old value: %s" % (config_key, config[section].get(config_key, '(None)')))
- value = raw_input("Enter new value (or just enter to keep the old): ")
+
+ if config_key == 'caldav_pass':
+ print("Config option caldav_pass - old value: **HIDDEN**")
+ value = getpass(prompt="Enter new value (or just enter to keep the old): ")
+ else:
+ print("Config option %s - old value: %s" % (config_key, config[section].get(config_key, '(None)')))
+ value = raw_input("Enter new value (or just enter to keep the old): ")
+
if value:
config[section][config_key] = value
modified = True