fixed error messages

master 3.7.1.3
parent f551f67ac2
commit f39830546c

@ -221,7 +221,6 @@ def local_method(metaObject, args, unknown_args):
try:
view = getattr(metaObject, method_view_name)(metaObject, 0, view_obj)
except AttributeError:
print("DE")
colorPrint.printERROR(_('Method not found: ') + method_view_name)
return 1
try:

@ -84,7 +84,7 @@ class BoolAutoAction(BoolAction):
available_values = ("on", "off", "yes", "no", "auto")
def _print(*args):
print(" ".join((_u8(x) for x in args)))
print(" ".join((x for x in args)))
def get_password(text1=None, text2=None, getfromstdin=False,
@ -486,25 +486,31 @@ def check_result_msg(method_result, view, input_error_dict=None, args=None):
return None
def _print_err(e):
if hasattr(e, "message"):
_print(e.message)
else:
_print(e)
def get_param_pwd(check_res, view, param_object, client=None,
stdin_passwd=False):
view = ViewInfoAdapter.from_detect(view)
for pwd_field in check_res:
if not stdin_passwd:
_print(check_res[pwd_field])
_print_err(check_res[pwd_field])
for group in view.groups:
for field in group.fields:
if field.name == pwd_field:
if field.element == 'table':
value = get_password(getfromstdin=stdin_passwd)
if value is None:
_print(check_res[pwd_field])
_print_err(check_res[pwd_field])
raise KeyboardInterrupt
set_table_pwd(client, param_object, field, value)
else:
value = get_password(getfromstdin=stdin_passwd)
if value is None:
_print(check_res[pwd_field])
_print_err(check_res[pwd_field])
raise KeyboardInterrupt
setattr(param_object, pwd_field, value)
return param_object

Loading…
Cancel
Save