From 608f1dd958c4d106fd4e9b74e0bdd2eb908bc2c8 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Tue, 17 Sep 2019 18:37:34 +0300 Subject: [PATCH] - made --shellvars into --shellvar and make it only one list of commands passed to the Tcl. The list is separated by comma but without spaces. The variables are accessed in Tcl with the names shellvar_x where x is the index in the list of command comma separated values - fixed an issue in the TclShell that generated an exception IndexError which crashed the software --- FlatCAMApp.py | 44 ++++++++++++++++++++------------------- README.md | 2 ++ flatcamTools/ToolShell.py | 11 ++++++---- 3 files changed, 32 insertions(+), 25 deletions(-) diff --git a/FlatCAMApp.py b/FlatCAMApp.py index 57d3b1a6..fe9abc0c 100644 --- a/FlatCAMApp.py +++ b/FlatCAMApp.py @@ -80,13 +80,13 @@ class App(QtCore.QObject): # Get Cmd Line Options cmd_line_shellfile = '' - cmd_line_shellvars = '' + cmd_line_shellvar = '' - cmd_line_help = "FlatCam.py --shellfile=\nFlatCam.py --shellvars= ' + text + '\n') if len(self._history) < 2 or self._history[-2] != text: # don't insert duplicating items - if text[-1] == '\n': - self._history.insert(-1, text[:-1]) - else: - self._history.insert(-1, text) + try: + if text[-1] == '\n': + self._history.insert(-1, text[:-1]) + else: + self._history.insert(-1, text) + except IndexError: + return self._historyIndex = len(self._history) - 1