TclCommandNew.py 1.3 KB

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