- added ability to run a FlatCAM Tcl script by double-clicking on the file
This commit is contained in:
parent
6e465d97cd
commit
39eaf12fef
|
@ -1693,6 +1693,20 @@ class App(QtCore.QObject):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug("Could not open FlatCAM Config file as App parameter due: %s" % str(e))
|
log.debug("Could not open FlatCAM Config file as App parameter due: %s" % str(e))
|
||||||
|
|
||||||
|
if '.FlatScript' in argument:
|
||||||
|
try:
|
||||||
|
file_name = str(argument)
|
||||||
|
|
||||||
|
if file_name == "":
|
||||||
|
self.inform.emit(_("Open Script file failed."))
|
||||||
|
else:
|
||||||
|
# run_from_arg = True
|
||||||
|
# self.worker_task.emit({'fcn': self.open_script_file,
|
||||||
|
# 'params': [file_name, run_from_arg]})
|
||||||
|
self.on_filerunscript(name=file_name)
|
||||||
|
except Exception as e:
|
||||||
|
log.debug("Could not open FlatCAM Script file as App parameter due: %s" % str(e))
|
||||||
|
|
||||||
def defaults_read_form(self):
|
def defaults_read_form(self):
|
||||||
for option in self.defaults_form_fields:
|
for option in self.defaults_form_fields:
|
||||||
try:
|
try:
|
||||||
|
@ -5848,7 +5862,7 @@ class App(QtCore.QObject):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug("App.on_fileopenscript() -> %s" % str(e))
|
log.debug("App.on_fileopenscript() -> %s" % str(e))
|
||||||
|
|
||||||
def on_filerunscript(self):
|
def on_filerunscript(self, name=None):
|
||||||
"""
|
"""
|
||||||
File menu callback for loading and running a TCL script.
|
File menu callback for loading and running a TCL script.
|
||||||
|
|
||||||
|
@ -5857,6 +5871,10 @@ class App(QtCore.QObject):
|
||||||
|
|
||||||
self.report_usage("on_filerunscript")
|
self.report_usage("on_filerunscript")
|
||||||
App.log.debug("on_file_runscript()")
|
App.log.debug("on_file_runscript()")
|
||||||
|
|
||||||
|
if name:
|
||||||
|
filename = name
|
||||||
|
else:
|
||||||
_filter_ = "TCL script (*.FlatScript);;TCL script (*.TCL);;TCL script (*.TXT);;All Files (*.*)"
|
_filter_ = "TCL script (*.FlatScript);;TCL script (*.TCL);;TCL script (*.TXT);;All Files (*.*)"
|
||||||
try:
|
try:
|
||||||
filename, _f = QtWidgets.QFileDialog.getOpenFileName(caption=_("Run TCL script"),
|
filename, _f = QtWidgets.QFileDialog.getOpenFileName(caption=_("Run TCL script"),
|
||||||
|
|
|
@ -13,6 +13,7 @@ CAD program, and create G-Code for Isolation routing.
|
||||||
|
|
||||||
- added ability to create new scripts and open scripts in FlatCAM Script Editor
|
- added ability to create new scripts and open scripts in FlatCAM Script Editor
|
||||||
- the Code Editor tab name is changed according to the task; 'save' and 'open' buttons will have filters installed for the QOpenDialog fit to the task
|
- the Code Editor tab name is changed according to the task; 'save' and 'open' buttons will have filters installed for the QOpenDialog fit to the task
|
||||||
|
- added ability to run a FlatCAM Tcl script by double-clicking on the file
|
||||||
|
|
||||||
17.03.2019
|
17.03.2019
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue