TclCommandGetNames.py 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. from ObjectCollection import *
  2. from tclCommands.TclCommand import TclCommand
  3. class TclCommandGetNames(TclCommand):
  4. """
  5. Tcl shell command to set an object as active in the GUI.
  6. example:
  7. """
  8. # List of all command aliases, to be able use old names for backward compatibility (add_poly, add_polygon)
  9. aliases = ['get_names']
  10. # Dictionary of types from Tcl command, needs to be ordered
  11. arg_names = collections.OrderedDict([
  12. ])
  13. # Dictionary of types from Tcl command, needs to be ordered , this is for options like -optionname value
  14. option_types = collections.OrderedDict([
  15. ])
  16. # array of mandatory options for current Tcl command: required = {'name','outname'}
  17. required = []
  18. # structured help for current command, args needs to be ordered
  19. help = {
  20. 'main': 'Lists the names of objects in the project.',
  21. 'args': collections.OrderedDict([
  22. ]),
  23. 'examples': []
  24. }
  25. def execute(self, args, unnamed_args):
  26. """
  27. :param args:
  28. :param unnamed_args:
  29. :return:
  30. """
  31. return '\n'.join(self.app.collection.get_names())