From 682dd721fe1f10626083762a75c11e2172daf770 Mon Sep 17 00:00:00 2001 From: Kload Date: Mon, 23 Sep 2013 17:13:24 +0000 Subject: [PATCH] Win message bugfix --- yunohost | 2 +- yunohost.py | 12 +----------- yunohost.tac | 3 +-- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/yunohost b/yunohost index 169f4e43..ee825b77 100755 --- a/yunohost +++ b/yunohost @@ -38,7 +38,7 @@ if not __debug__: gettext.install('YunoHost') try: - from yunohost import YunoHostError, YunoHostLDAP, str_to_func, colorize, pretty_print_dict, display_error, validate, win, reset_win_messages, parse_dict + from yunohost import YunoHostError, YunoHostLDAP, str_to_func, colorize, pretty_print_dict, display_error, validate, win, parse_dict except ImportError: sys.stderr.write('Error: Yunohost CLI Require YunoHost lib\n') sys.exit(1) diff --git a/yunohost.py b/yunohost.py index 5be80f05..0dfb600d 100644 --- a/yunohost.py +++ b/yunohost.py @@ -120,20 +120,10 @@ def win_msg(astr): if os.isatty(1): print('\n' + colorize(_("Success: "), 'green') + astr + '\n') + del win[:] win.append(astr) - -def reset_win_messages(): - """ - Empty the win array - - """ - global win - - win = [] - - def str_to_func(astr): """ Call a function from a string name diff --git a/yunohost.tac b/yunohost.tac index dc2d7d38..78308d66 100755 --- a/yunohost.tac +++ b/yunohost.tac @@ -14,7 +14,7 @@ from twisted.web.server import Site, http from twisted.internet import reactor from twisted.application import internet,service from txrestapi.resource import APIResource -from yunohost import YunoHostError, YunoHostLDAP, str_to_func, colorize, pretty_print_dict, display_error, validate, win, parse_dict, reset_win_messages +from yunohost import YunoHostError, YunoHostLDAP, str_to_func, colorize, pretty_print_dict, display_error, validate, win, parse_dict if not __debug__: import traceback @@ -116,7 +116,6 @@ def http_exec(request, **kwargs): result = {} if len(win) > 0: result['win'] = win - reset_win_messages() # Build response if request.method == 'POST':