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') gettext.install('YunoHost')
try: 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: except ImportError:
sys.stderr.write('Error: Yunohost CLI Require YunoHost lib\n') sys.stderr.write('Error: Yunohost CLI Require YunoHost lib\n')
sys.exit(1) sys.exit(1)

View file

@ -120,20 +120,10 @@ def win_msg(astr):
if os.isatty(1): if os.isatty(1):
print('\n' + colorize(_("Success: "), 'green') + astr + '\n') print('\n' + colorize(_("Success: "), 'green') + astr + '\n')
del win[:]
win.append(astr) win.append(astr)
def reset_win_messages():
"""
Empty the win array
"""
global win
win = []
def str_to_func(astr): def str_to_func(astr):
""" """
Call a function from a string name 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.internet import reactor
from twisted.application import internet,service from twisted.application import internet,service
from txrestapi.resource import APIResource 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__: if not __debug__:
import traceback import traceback
@ -116,7 +116,6 @@ def http_exec(request, **kwargs):
result = {} result = {}
if len(win) > 0: if len(win) > 0:
result['win'] = win result['win'] = win
reset_win_messages()
# Build response # Build response
if request.method == 'POST': if request.method == 'POST':