TclCommandNew.py 1.3 KB

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