draft for reimplementation of tcl commands to separated files/modules
This commit is contained in:
@@ -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'])
|
||||
|
||||
Reference in New Issue
Block a user