TclCommandClearShell.py 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. from tclCommands.TclCommand import TclCommand
  2. from ObjectCollection import *
  3. class TclCommandClearShell(TclCommand):
  4. """
  5. Tcl shell command to clear the text in the Tcl Shell browser.
  6. example:
  7. """
  8. # List of all command aliases, to be able use old names for backward compatibility (add_poly, add_polygon)
  9. aliases = ['clear']
  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': "Clear the text in the Tcl Shell browser.",
  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. self.app.inform.emit("Tcl Shell Editor cleared ...")
  32. self.app.shell._browser.clear()
  33. pass