mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Win message bugfix
This commit is contained in:
parent
2ad1a32419
commit
682dd721fe
3 changed files with 3 additions and 14 deletions
2
yunohost
2
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)
|
||||
|
|
12
yunohost.py
12
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
|
||||
|
|
|
@ -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':
|
||||
|
|
Loading…
Add table
Reference in a new issue