- in the 'cutout' Tcl command made sure that when an error pop-up then it returns with a "fail" string

- made sure when running scripts from the interface that if a command will generate an error then the script is aborted
This commit is contained in:
Marius Stanciu
2022-01-18 00:30:10 +02:00
committed by Marius
parent 87f1b7e15e
commit 3363dd0fe8
4 changed files with 18 additions and 3 deletions

View File

@@ -264,7 +264,12 @@ class ScriptObject(FlatCAMObj):
result = self.app.shell.tcl.eval(str(new_command))
if result != 'None':
self.app.shell.append_output(result + '\n')
if result == 'fail':
self.app.ui.fcinfo.lock_pmaps = False
self.app.shell.close_processing()
self.app.inform.emit("[ERROR] %s: %s" % (_("Tcl Command failed"), str(new_command)))
self.app.inform.emit("[ERROR] %s" % _("Aborting."))
return
old_line = ''
except tk.TclError:
old_line = old_line + tcl_command_line + '\n'