From cbc4d2aab54f42714277d6787ba9935dcd823705 Mon Sep 17 00:00:00 2001 From: Etienne Pallier Date: Tue, 3 Jan 2023 14:09:50 +0100 Subject: [PATCH] modif separateurs get_all_cmds --- src/core/pyros_django/agent/Agent.py | 14 +++++++++----- src/core/pyros_django/agent/AgentBasic.py | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/core/pyros_django/agent/Agent.py b/src/core/pyros_django/agent/Agent.py index a6af7d8..2ed9532 100755 --- a/src/core/pyros_django/agent/Agent.py +++ b/src/core/pyros_django/agent/Agent.py @@ -2776,7 +2776,11 @@ class Agent: # Tooltip separator #TSEP = ',' - TSEP = '/' + T_SEP = '/' + + # Arguments separator + #A_SEP = ',' + A_SEP = '|' # For each command #for command_tuple in self._AGENT_SPECIFIC_COMMANDS: @@ -2789,7 +2793,7 @@ class Agent: # 1) Error case 1 - Misnamed (Invalid syntax) command (not get, set, do) (implemented or not) if not AgentCmd.is_generic_name(cmd_name): #cmds += '(I),;' - cmds += f'(I){TSEP};' + cmds += f'(I){T_SEP};' continue # 2) Error case 2 - Well named command (get, set, do) but not yet implemented @@ -2800,7 +2804,7 @@ class Agent: # Tag this command as UNIMPLEMENTED (U) => 'cmd_name(U)' #raise CmdExceptionUnimplemented(cmd_name) from None #cmds += '(U),;' - cmds += f'(U){TSEP};' + cmds += f'(U){T_SEP};' # next cmd continue @@ -2812,7 +2816,7 @@ class Agent: #print(args.parameters) for arg in args.parameters.values(): arg_type = arg.annotation.__name__ if isinstance(arg.annotation,type) else str(arg.annotation) - cmds += arg.name+":"+arg_type+"," + cmds += arg.name+":"+arg_type + A_SEP #print("name, annot:", arg.name, arg.annotation) #print("annot.nam e:", arg.annotation.__name__) #print(type(arg.annotation)) @@ -2830,7 +2834,7 @@ class Agent: # cmds += str(args) if args.parameters: cmds = cmds[:-1] #cmds += ")," - cmds += f"){TSEP}" + cmds += f"){T_SEP}" # 4) Add tooltip (only for Speciic commands) if self.is_agent_specific_cmd(cmd_name): diff --git a/src/core/pyros_django/agent/AgentBasic.py b/src/core/pyros_django/agent/AgentBasic.py index 17d3900..efea37c 100755 --- a/src/core/pyros_django/agent/AgentBasic.py +++ b/src/core/pyros_django/agent/AgentBasic.py @@ -78,7 +78,7 @@ class AgentBasic(Agent): # noprio (True, " self get_all_cmds noprio ", 100, None, - #'do_specific10(arg1:int,arg2:int,arg3:float,arg4:str,arg5:typing.Tuple[int, str, int],arg6:typing.List[int]);do_specific30();do_cmd_raising_some_exception();do_cmd_unimplemented(U)', + "do_eval(eval_str:str)/;get_status()/;get_state()/;get_mode()/;set_mode(mode:typing.Literal['IDLE', 'ROUTINE', 'ATTENTIVE'])/;do_stop(when:typing.Literal['asap', 'now', 'noprio'])/;do_exec_commands(what:typing.Literal['stop', 'resume', 'noprio'])/;do_stop_current(what:typing.Literal['cmd', 'routine', 'both'])/;do_flush_pending_commands()/;do_restart(when:typing.Literal['asap', 'now', 'noprio'])/;get_all_cmds(noprio:str)/;get_specific_cmds()/;do_cmd_unimplemented_and_declared(U)/;cmd_misnamed_and_declared(I)/;do_cmd_raising_some_exception()/;do_specific10(arg1:int|arg2:int|arg3:float|arg4:str|arg5:typing.Tuple[int, str, int]|arg6:typing.List[int])/;do_specific30()/;do_cmd_with_long_exec_time()/A command that takes a long time to exec", Agent.CMD_STATUS.CMD_EXECUTED ), -- libgit2 0.21.2