TclCommandNew.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. from ObjectCollection import *
  2. from tclCommands.TclCommand import TclCommand
  3. class TclCommandNew(TclCommand):
  4. """
  5. Tcl shell command to starts a new project. Clears objects from memory
  6. """
  7. # array of all command aliases, to be able use old names for backward compatibility (add_poly, add_polygon)
  8. aliases = ['new']
  9. # dictionary of types from Tcl command, needs to be ordered
  10. arg_names = collections.OrderedDict()
  11. # dictionary of types from Tcl command, needs to be ordered , this is for options like -optionname value
  12. option_types = collections.OrderedDict()
  13. # array of mandatory options for current Tcl command: required = {'name','outname'}
  14. required = []
  15. # structured help for current command, args needs to be ordered
  16. help = {
  17. 'main': "Starts a new project. Clears objects from memory.",
  18. 'args': collections.OrderedDict(),
  19. 'examples': []
  20. }
  21. def execute(self, args, unnamed_args):
  22. """
  23. execute current TCL shell command
  24. :param args: array of known named arguments and options
  25. :param unnamed_args: array of other values which were passed into command
  26. without -somename and we do not have them in known arg_names
  27. :return: None or exception
  28. """
  29. self.app.on_file_new()