TclCommandSaveSys.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. from tclCommands.TclCommand import *
  2. class TclCommandSaveSys(TclCommandSignaled):
  3. """
  4. Tcl shell command to save the FlatCAM defaults settings to file.
  5. """
  6. # array of all command aliases, to be able use old names for backward compatibility (add_poly, add_polygon)
  7. aliases = ['save_sys', 'save']
  8. # Dictionary of types from Tcl command, needs to be ordered.
  9. # For positional arguments
  10. arg_names = collections.OrderedDict([
  11. ])
  12. # Dictionary of types from Tcl command, needs to be ordered.
  13. # 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': "Saves the FlatCAM system paramaters to defaults file.",
  21. 'args': collections.OrderedDict([]),
  22. 'examples': []
  23. }
  24. def execute(self, args, unnamed_args):
  25. """
  26. execute current TCL shell command
  27. :param args: array of known named arguments and options
  28. :param unnamed_args: array of other values which were passed into command
  29. without -somename and we do not have them in known arg_names
  30. :return: None or exception
  31. """
  32. self.app.save_defaults(args)