TclCommandSaveSys.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # ##########################################################
  2. # FlatCAM: 2D Post-processing for Manufacturing #
  3. # File Author: Marius Adrian Stanciu (c) #
  4. # Date: 8/17/2019 #
  5. # MIT Licence #
  6. # ##########################################################
  7. from tclCommands.TclCommand import *
  8. class TclCommandSaveSys(TclCommandSignaled):
  9. """
  10. Tcl shell command to save the FlatCAM defaults settings to file.
  11. """
  12. # array of all command aliases, to be able use old names for backward compatibility (add_poly, add_polygon)
  13. aliases = ['save_sys', 'save']
  14. # Dictionary of types from Tcl command, needs to be ordered.
  15. # For positional arguments
  16. arg_names = collections.OrderedDict([
  17. ])
  18. # Dictionary of types from Tcl command, needs to be ordered.
  19. # For options like -optionname value
  20. option_types = collections.OrderedDict([
  21. ])
  22. # array of mandatory options for current Tcl command: required = {'name','outname'}
  23. required = []
  24. # structured help for current command, args needs to be ordered
  25. help = {
  26. 'main': "Saves the FlatCAM system paramaters to defaults file.",
  27. 'args': collections.OrderedDict([]),
  28. 'examples': []
  29. }
  30. def execute(self, args, unnamed_args):
  31. """
  32. execute current TCL shell command
  33. :param args: array of known named arguments and options
  34. :param unnamed_args: array of other values which were passed into command
  35. without -somename and we do not have them in known arg_names
  36. :return: None or exception
  37. """
  38. self.app.save_defaults(args)