From a0da8060f6cd2ac00f8ba26182091eb2ed1311de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Sun, 20 Jul 2014 18:14:56 +0200 Subject: [PATCH] [enh] Rely on format string method for ask_string encoding in hook --- hook.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hook.py b/hook.py index f9d2e9b9b..2155df317 100644 --- a/hook.py +++ b/hook.py @@ -129,7 +129,7 @@ def hook_exec(file, args=None): args -- Arguments to pass to the script """ - from yunohost.app import _value_for_locale, _encode_string + from yunohost.app import _value_for_locale if isinstance(args, list): arg_list = args @@ -152,11 +152,9 @@ def hook_exec(file, args=None): # Append extra strings if 'choices' in arg: - ask_string += ' ({:s})'.format( - _encode_string('|'.join(arg['choices']))) + ask_string += ' ({:s})'.format('|'.join(arg['choices'])) if 'default' in arg: - ask_string += ' (default: {:s})'.format( - _encode_string(arg['default'])) + ask_string += ' (default: {:s})'.format(arg['default']) input_string = msignals.prompt(ask_string)