From 26ec5da55afc4d677bec3a498808793e185fe5f4 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Sun, 13 Oct 2019 17:59:57 +0200 Subject: [PATCH] Fixes #307: Remove remaining uses of is_command; --- weboob/tools/application/console.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/weboob/tools/application/console.py b/weboob/tools/application/console.py index 0335b3c11e..5c8410e9cd 100644 --- a/weboob/tools/application/console.py +++ b/weboob/tools/application/console.py @@ -442,22 +442,16 @@ def ask(self, question, default=None, masked=None, regexp=None, choices=None, ti choices['p'] = 'Prompt value when needed (do not store it)' choices['s'] = 'Store value in config' - if v.is_command(v.default): - d = 'c' - elif v.default == '' and not v.noprompt: - d = 'p' + if v.default == '' and not v.noprompt: + default = 'p' else: - d = 's' + default = 's' - r = self.ask('*** How do you want to store it?', choices=choices, tiny=True, default=d) + r = self.ask('*** How do you want to store it?', choices=choices, tiny=True, default=default) if r == 'p': return '' if r == 'c': print('Enter the shell command that will print the required value on the standard output') - if v.is_command(v.default): - print(': %s' % v.default[1:-1]) - else: - d = None while True: cmd = self.ask('') try: -- GitLab