From 2243d3ce60294d51bc540c621df51466d62b183c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Mon, 2 Jun 2014 17:11:32 +0200 Subject: [PATCH] [enh] Display prompting message in yellow on authentication --- moulinette/interfaces/cli.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/moulinette/interfaces/cli.py b/moulinette/interfaces/cli.py index 133dd658..b4ebb265 100644 --- a/moulinette/interfaces/cli.py +++ b/moulinette/interfaces/cli.py @@ -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: