TclCommandSaveSys.py 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. description = '%s %s' % ("--", "Saves the FlatCAM system parameters to defaults file.")
  15. # Dictionary of types from Tcl command, needs to be ordered.
  16. # For positional arguments
  17. arg_names = collections.OrderedDict([
  18. ])
  19. # Dictionary of types from Tcl command, needs to be ordered.
  20. # For options like -optionname value
  21. option_types = collections.OrderedDict([
  22. ])
  23. # array of mandatory options for current Tcl command: required = {'name','outname'}
  24. required = []
  25. # structured help for current command, args needs to be ordered
  26. help = {
  27. 'main': "Saves the FlatCAM system parameters to defaults file.",
  28. 'args': collections.OrderedDict([]),
  29. 'examples': ['save_sys']
  30. }
  31. def execute(self, args, unnamed_args):
  32. """
  33. execute current TCL shell command
  34. :param args: array of known named arguments and options
  35. :param unnamed_args: array of other values which were passed into command
  36. without -somename and we do not have them in known arg_names
  37. :return: None or exception
  38. """
  39. self.app.save_defaults(args)