Commit cbc4d2aab54f42714277d6787ba9935dcd823705

Authored by Etienne Pallier
1 parent 2d3e16c7
Exists in dev

modif separateurs get_all_cmds

src/core/pyros_django/agent/Agent.py
@@ -2776,7 +2776,11 @@ class Agent: @@ -2776,7 +2776,11 @@ class Agent:
2776 2776
2777 # Tooltip separator 2777 # Tooltip separator
2778 #TSEP = ',' 2778 #TSEP = ','
2779 - TSEP = '/' 2779 + T_SEP = '/'
  2780 +
  2781 + # Arguments separator
  2782 + #A_SEP = ','
  2783 + A_SEP = '|'
2780 2784
2781 # For each command 2785 # For each command
2782 #for command_tuple in self._AGENT_SPECIFIC_COMMANDS: 2786 #for command_tuple in self._AGENT_SPECIFIC_COMMANDS:
@@ -2789,7 +2793,7 @@ class Agent: @@ -2789,7 +2793,7 @@ class Agent:
2789 # 1) Error case 1 - Misnamed (Invalid syntax) command (not get, set, do) (implemented or not) 2793 # 1) Error case 1 - Misnamed (Invalid syntax) command (not get, set, do) (implemented or not)
2790 if not AgentCmd.is_generic_name(cmd_name): 2794 if not AgentCmd.is_generic_name(cmd_name):
2791 #cmds += '(I),;' 2795 #cmds += '(I),;'
2792 - cmds += f'(I){TSEP};' 2796 + cmds += f'(I){T_SEP};'
2793 continue 2797 continue
2794 2798
2795 # 2) Error case 2 - Well named command (get, set, do) but not yet implemented 2799 # 2) Error case 2 - Well named command (get, set, do) but not yet implemented
@@ -2800,7 +2804,7 @@ class Agent: @@ -2800,7 +2804,7 @@ class Agent:
2800 # Tag this command as UNIMPLEMENTED (U) => 'cmd_name(U)' 2804 # Tag this command as UNIMPLEMENTED (U) => 'cmd_name(U)'
2801 #raise CmdExceptionUnimplemented(cmd_name) from None 2805 #raise CmdExceptionUnimplemented(cmd_name) from None
2802 #cmds += '(U),;' 2806 #cmds += '(U),;'
2803 - cmds += f'(U){TSEP};' 2807 + cmds += f'(U){T_SEP};'
2804 # next cmd 2808 # next cmd
2805 continue 2809 continue
2806 2810
@@ -2812,7 +2816,7 @@ class Agent: @@ -2812,7 +2816,7 @@ class Agent:
2812 #print(args.parameters) 2816 #print(args.parameters)
2813 for arg in args.parameters.values(): 2817 for arg in args.parameters.values():
2814 arg_type = arg.annotation.__name__ if isinstance(arg.annotation,type) else str(arg.annotation) 2818 arg_type = arg.annotation.__name__ if isinstance(arg.annotation,type) else str(arg.annotation)
2815 - cmds += arg.name+":"+arg_type+"," 2819 + cmds += arg.name+":"+arg_type + A_SEP
2816 #print("name, annot:", arg.name, arg.annotation) 2820 #print("name, annot:", arg.name, arg.annotation)
2817 #print("annot.nam e:", arg.annotation.__name__) 2821 #print("annot.nam e:", arg.annotation.__name__)
2818 #print(type(arg.annotation)) 2822 #print(type(arg.annotation))
@@ -2830,7 +2834,7 @@ class Agent: @@ -2830,7 +2834,7 @@ class Agent:
2830 # cmds += str(args) 2834 # cmds += str(args)
2831 if args.parameters: cmds = cmds[:-1] 2835 if args.parameters: cmds = cmds[:-1]
2832 #cmds += ")," 2836 #cmds += "),"
2833 - cmds += f"){TSEP}" 2837 + cmds += f"){T_SEP}"
2834 2838
2835 # 4) Add tooltip (only for Speciic commands) 2839 # 4) Add tooltip (only for Speciic commands)
2836 if self.is_agent_specific_cmd(cmd_name): 2840 if self.is_agent_specific_cmd(cmd_name):
src/core/pyros_django/agent/AgentBasic.py
@@ -78,7 +78,7 @@ class AgentBasic(Agent): @@ -78,7 +78,7 @@ class AgentBasic(Agent):
78 # noprio 78 # noprio
79 (True, " self get_all_cmds noprio ", 100, 79 (True, " self get_all_cmds noprio ", 100,
80 None, 80 None,
81 - #'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)', 81 + "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",
82 Agent.CMD_STATUS.CMD_EXECUTED 82 Agent.CMD_STATUS.CMD_EXECUTED
83 ), 83 ),
84 84