draft for reimplementation of tcl commands to separated files/modules

This commit is contained in:
Kamil Sopko
2016-03-16 18:57:43 +01:00
parent 4df46df19b
commit cd6700152c
5 changed files with 359 additions and 1 deletions

View File

@@ -25,7 +25,7 @@ from FlatCAMDraw import FlatCAMDraw
from FlatCAMProcess import *
from MeasurementTool import Measurement
from DblSidedTool import DblSidedTool
import tclCommands
########################################
## App ##
@@ -660,6 +660,8 @@ class App(QtCore.QObject):
if not isinstance(unknownException, self.TclErrorException):
self.raiseTclError("Unknown error: %s" % str(unknownException))
else:
raise unknownException
def raiseTclError(self, text):
"""
@@ -3547,6 +3549,9 @@ class App(QtCore.QObject):
}
}
#import/overwrite tcl commands as objects of TclCommand descendants
tclCommands.register_all_commands(self, commands)
# Add commands to the tcl interpreter
for cmd in commands:
self.tcl.createcommand(cmd, commands[cmd]['fcn'])