mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
[enh] Display prompting message in yellow on authentication
This commit is contained in:
parent
203c8fb511
commit
2243d3ce60
1 changed files with 8 additions and 4 deletions
|
@ -219,19 +219,23 @@ class Interface(BaseInterface):
|
|||
"""
|
||||
# TODO: Allow token authentication?
|
||||
msg = help or m18n.g('password')
|
||||
return authenticator(password=self._do_prompt(msg, True, False))
|
||||
return authenticator(password=self._do_prompt(msg, True, False,
|
||||
color='yellow'))
|
||||
|
||||
def _do_prompt(self, message, is_password, confirm):
|
||||
def _do_prompt(self, message, is_password, confirm, color='blue'):
|
||||
"""Prompt for a value
|
||||
|
||||
Handle the core.MoulinetteSignals.prompt signal.
|
||||
|
||||
Keyword arguments:
|
||||
- color -- The color to use for prompting message
|
||||
|
||||
"""
|
||||
if is_password:
|
||||
prompt = lambda m: getpass.getpass(colorize(m18n.g('colon', m),
|
||||
'blue'))
|
||||
color))
|
||||
else:
|
||||
prompt = lambda m: raw_input(colorize(m18n.g('colon', m), 'blue'))
|
||||
prompt = lambda m: raw_input(colorize(m18n.g('colon', m), color))
|
||||
value = prompt(message)
|
||||
|
||||
if confirm:
|
||||
|
|
Loading…
Reference in a new issue