Win message bugfix

This commit is contained in:
Kload 2013-09-23 17:13:24 +00:00
parent 2ad1a32419
commit 682dd721fe
3 changed files with 3 additions and 14 deletions

View file

@ -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)

View file

@ -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

View file

@ -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':