From a3b5c858c7ef9f3d2d4acf956442e6f950754e48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B8=D1=80=D0=B5=D1=86=D0=BA=D0=B8=D0=B9=20=D0=9C?= =?UTF-8?q?=D0=B8=D1=85=D0=B0=D0=B8=D0=BB?= Date: Fri, 12 Oct 2012 13:51:21 +0400 Subject: [PATCH] New passwords --- console/application/cl_client.py | 2 +- console/application/function.py | 2 +- console/application/methods_func.py | 11 ++++------- console/application/pid_information.py | 6 ++++-- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/console/application/cl_client.py b/console/application/cl_client.py index feb93ab..aaa1a03 100644 --- a/console/application/cl_client.py +++ b/console/application/cl_client.py @@ -268,7 +268,7 @@ def https_server(client, args, unknown_args, url, clVarsCore, wait_thread): client.frame_period = clVarsCore.Get('core.cl_core_get_frame_period') except: client.frame_period = 2 - method_result = call_method(client, args, wait_thread) + method_result = call_method(client, args, unknown_args, wait_thread) if method_result: client.no_progress = args.no_progress try: diff --git a/console/application/function.py b/console/application/function.py index 23a5af2..5251d9e 100644 --- a/console/application/function.py +++ b/console/application/function.py @@ -358,7 +358,7 @@ def analysis(client, sid, s): def get_message(client, item, sid, pid): """ get one message by its type """ for case in switch(item.type): - if case('normal'): + if case('normal') or case('plain'): # sys.stdout.flush() # sys.stdout.write('\x1b[1;33m' + item.message + '\033[0m') if item.message: diff --git a/console/application/methods_func.py b/console/application/methods_func.py index 2087b4a..5c0f4a0 100644 --- a/console/application/methods_func.py +++ b/console/application/methods_func.py @@ -22,7 +22,7 @@ import urllib2 from calculate.core.server.methods_func import get_method_argparser, \ collect_object, RawAndDefaultsHelpFormatter, \ - check_result_msg, get_param_pwd + check_result_msg, get_param_pwd, getErrorOnParam def parse(): parser = argparse.ArgumentParser(add_help=False, @@ -104,7 +104,7 @@ def get_view(client, method, sid, view_params): raise Exception(1) return view -def call_method(client, args, wait_thread): +def call_method(client, args, unknown_args, wait_thread): method = args.method no_questions = args.no_questions stdin_passwd = args.stdin_passwd @@ -115,7 +115,7 @@ def call_method(client, args, wait_thread): method_parser = get_method_argparser(view, args) param_object = _create_obj(client, method) try: - args, unknown_args = method_parser.parse_known_args() + args, unknown_args = method_parser.parse_known_args(unknown_args) except SystemExit: raise Exception(1) for i in unknown_args: @@ -182,10 +182,7 @@ def call_method(client, args, wait_thread): for Group in view.groups.GroupField: for field in Group.fields.Field: if field.name == error.field: - if field.opt.shortopt or field.opt.longopt: - params_text += _('Wrong option ') - params_text += ', '.join(filter(None, - [field.opt.shortopt, field.opt.longopt]))+'. ' + params_text += getErrorOnParam(args,field) red = '\033[31m * \033[0m' _print ('\r' + red + params_text + error.message) return None diff --git a/console/application/pid_information.py b/console/application/pid_information.py index b4c31b6..fefde6a 100644 --- a/console/application/pid_information.py +++ b/console/application/pid_information.py @@ -97,7 +97,7 @@ def client_list_methods(client): RES = 0 # Access to result COM = 0 # Getting command line METH = 1 # Getting method line - TR_METH = 2 # Translate method name + TR_METH = 3 # Translate method name results = client.service.get_methods(client.sid, client_types) if not results: print _('No methods available') @@ -111,8 +111,10 @@ def client_list_methods(client): print _("You can execute:"), _('use'), '--method' group_dict = {} for group in results.stringArray: - if len (group.string) == 3: + if len (group.string) == 4: group_dict[group.string[METH]] = group.string[TR_METH] + if len (group.string) == 3: + group_dict[group.string[METH]] = group.string[TR_METH-1] sort_keys = group_dict.keys() sort_keys.sort() for key in sort_keys: