From 6802111795422daa171aa480b8610cb31fe24139 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=9B=BD=E8=BE=89?= Date: Wed, 31 Jul 2024 01:39:46 +0000 Subject: [PATCH] =?UTF-8?q?Signed-off-by:=20=E9=BB=84=E5=9B=BD=E8=BE=89=20?= =?UTF-8?q??= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄国辉 --- src/core/command/console.py | 45 +++++++++++++------------------------ 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/src/core/command/console.py b/src/core/command/console.py index 31ffca2..5ff82ed 100755 --- a/src/core/command/console.py +++ b/src/core/command/console.py @@ -65,21 +65,6 @@ class Console(object): def __init__(self): pass - - @staticmethod - def _parse_combination_param(combination_value): - # sample: size:xxx1;exclude-annotation:xxx - parse_result = {} - key_value_pairs = str(combination_value).split(";") - for key_value_pair in key_value_pairs: - key, value = key_value_pair.split(":", 1) - if not value: - raise ParamError("'%s' no value" % key) - value_list = str(value).split(",") - exist_list = parse_result.get(key, []) - exist_list.extend(value_list) - parse_result[key] = exist_list - return parse_result @staticmethod def _parse_combination_param(combination_value): @@ -397,21 +382,6 @@ class Console(object): def handler_ctrl_z(self, signalnum, frame): pass - - def console(self, args): - """ - Main xDevice console providing user with the interface to interact - """ - EnvironmentManager() - if args is None or len(args) < 2: - self.wizard_dic = show_wizard_mode() - print(self.wizard_dic) - if self._build_version(self.wizard_dic["productform"]): - self._console() - else: - LOG.error("Build version failed, exit test framework.") - else: - self.command_parser(" ".join(args[1:])) def command_parser(self, args): try: @@ -455,6 +425,21 @@ class Console(object): except (AttributeError, IOError, IndexError, ImportError, NameError, RuntimeError, SystemError, TypeError, ValueError) as exception: LOG.exception(exception, exc_info=False) + + def console(self, args): + """ + Main xDevice console providing user with the interface to interact + """ + EnvironmentManager() + if args is None or len(args) < 2: + self.wizard_dic = show_wizard_mode() + print(self.wizard_dic) + if self._build_version(self.wizard_dic["productform"]): + self._console() + else: + LOG.error("Build version failed, exit test framework.") + else: + self.command_parser(" ".join(args[1:])) # 命令执行总入口 def _console(self): -- Gitee