summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Brox <tobias@redpill-linpro.com>2019-08-11 10:28:58 +0000
committerGitHub <noreply@github.com>2019-08-11 10:28:58 +0000
commitee8e04e62e1f105e8f76516b7184e7febe9e1a97 (patch)
treed0c964a55a4f573bd94ce9e483963e64817c9626
parentc3112f7821fb01bffc7ff2e53dea9637ad7fbeb2 (diff)
parentf34a3494d27b434b3c8b4ac5d0beaa507b0bfcb0 (diff)
downloadcalendar-cli-ee8e04e62e1f105e8f76516b7184e7febe9e1a97.zip
Merge pull request #55 from mkapra/getpass_fix
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