From 790eaf07836b2b06b7adbf8f6f0c1f650cf5a666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Mon, 2 Jun 2014 15:04:07 +0200 Subject: [PATCH] [fix] Print message inside prompting function in the cli --- moulinette/interfaces/cli.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/moulinette/interfaces/cli.py b/moulinette/interfaces/cli.py index c6592d52..133dd658 100644 --- a/moulinette/interfaces/cli.py +++ b/moulinette/interfaces/cli.py @@ -1,8 +1,5 @@ # -*- coding: utf-8 -*- -# TODO: Switch to python3! -from __future__ import print_function - import os import errno import getpass @@ -231,13 +228,10 @@ class Interface(BaseInterface): """ if is_password: - def prompt(m): - print(colorize(m18n.g('colon', m), 'blue'), end='') - return getpass.getpass() + prompt = lambda m: getpass.getpass(colorize(m18n.g('colon', m), + 'blue')) else: - def prompt(m): - print(colorize(m18n.g('colon', m), 'blue'), end='') - return raw_input() + prompt = lambda m: raw_input(colorize(m18n.g('colon', m), 'blue')) value = prompt(message) if confirm: