summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain <syt@logilab.fr>2007-02-11 12:08:17 +0100
committerSylvain <syt@logilab.fr>2007-02-11 12:08:17 +0100
commitb28c2a5b7410fc132cd6cc091795e2cec25a3d50 (patch)
tree2e1a29a58d908f787ebd0a59aea76e8e9cebe0c2
parenta614f9a3f59095f8a908076485c9e8135f35f16a (diff)
downloadlogilab-common-b28c2a5b7410fc132cd6cc091795e2cec25a3d50.tar.gz
no default when asking for a password
-rw-r--r--configuration.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/configuration.py b/configuration.py
index f532f37..744eae6 100644
--- a/configuration.py
+++ b/configuration.py
@@ -480,17 +480,19 @@ class OptionsManagerMixIn(object):
if onlysection is not None and section != onlysection:
continue
default = provider.option_default(option, optdict)
- if default is REQUIRED:
- defaultstr = 'required'
+ if optdict['type'] == 'password':
+ defaultstr = ': '
+ elif default is REQUIRED:
+ defaultstr = '(required): '
else:
if optdict.get('inputlevel', 0) > inputlevel:
provider.set_option(option, default, opt_dict=optdict)
continue
- defaultstr = 'default: %s' % format_option_value(optdict, default)
+ defaultstr = '(default: %s): ' % format_option_value(optdict, default)
print ':%s:' % option
print optdict.get('help') or option
inputfunc = INPUT_FUNCTIONS[optdict['type']]
- value = inputfunc(optdict, '(%s): ' % defaultstr)
+ value = inputfunc(optdict, defaultstr)
while default is REQUIRED and not value:
print 'please specify a value'
value = inputfunc(optdict, '%s: ' % option)