diff options
author | Maximilian Kapra <maximilian@kapra.de> | 2019-08-11 12:16:07 +0200 |
---|---|---|
committer | Maximilian Kapra <maximilian@kapra.de> | 2019-08-11 12:16:07 +0200 |
commit | f34a3494d27b434b3c8b4ac5d0beaa507b0bfcb0 (patch) | |
tree | d0c964a55a4f573bd94ce9e483963e64817c9626 | |
parent | c3112f7821fb01bffc7ff2e53dea9637ad7fbeb2 (diff) | |
download | calendar-cli-f34a3494d27b434b3c8b4ac5d0beaa507b0bfcb0.zip |
Adding getpass module. Password not echoing to terminal anymore.
-rwxr-xr-x | calendar-cli.py | 11 |
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 |