- added the possibility of selecting which system parameters to list
starting with the letter(s) offered as argument. It's a way to narrow the list down. If no selection letters are offered it will list on screen the entire list of system parameters.
This commit is contained in:
@@ -14,6 +14,7 @@ class TclCommandListSys(TclCommand):
|
|||||||
|
|
||||||
# Dictionary of types from Tcl command, needs to be ordered
|
# Dictionary of types from Tcl command, needs to be ordered
|
||||||
arg_names = collections.OrderedDict([
|
arg_names = collections.OrderedDict([
|
||||||
|
('selection', str),
|
||||||
])
|
])
|
||||||
|
|
||||||
# Dictionary of types from Tcl command, needs to be ordered , this is for options like -optionname value
|
# Dictionary of types from Tcl command, needs to be ordered , this is for options like -optionname value
|
||||||
@@ -27,10 +28,17 @@ class TclCommandListSys(TclCommand):
|
|||||||
# structured help for current command, args needs to be ordered
|
# structured help for current command, args needs to be ordered
|
||||||
help = {
|
help = {
|
||||||
'main': "Returns the list of the names of system variables.\n"
|
'main': "Returns the list of the names of system variables.\n"
|
||||||
"Note: Use get_sys command to get the value and set_sys command to set it.",
|
"Without a parameter it will list all the system parameters. "
|
||||||
|
"As a parameter use first letter or first letters from the name "
|
||||||
|
"of the system variable.\n"
|
||||||
|
"In that case it will list only the system variables that starts with that string.\n"
|
||||||
|
"Main categories start with: gerber or excellon or geometry or cncjob or global.\n"
|
||||||
|
"Note: Use get_sys command to get the value and set_sys command to set it.\n",
|
||||||
'args': collections.OrderedDict([
|
'args': collections.OrderedDict([
|
||||||
]),
|
]),
|
||||||
'examples': []
|
'examples': ['list_sys',
|
||||||
|
'list_sys gerber',
|
||||||
|
'list_sys cncjob']
|
||||||
}
|
}
|
||||||
|
|
||||||
def execute(self, args, unnamed_args):
|
def execute(self, args, unnamed_args):
|
||||||
@@ -40,4 +48,9 @@ class TclCommandListSys(TclCommand):
|
|||||||
:param unnamed_args:
|
:param unnamed_args:
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
return str([*self.app.defaults])
|
if 'selection' in args:
|
||||||
|
argument = args['selection']
|
||||||
|
print(argument)
|
||||||
|
return str([k for k in self.app.defaults.keys() if str(k).startswith(str(argument))])
|
||||||
|
else:
|
||||||
|
return str([*self.app.defaults])
|
||||||
Reference in New Issue
Block a user