From eb0637c5bbea29c2911a7ec3b66d0189eda17b81 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Sat, 26 May 2018 19:10:07 +0300 Subject: [PATCH 1/3] - minor PEP changes --- camlib.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/camlib.py b/camlib.py index d79b4532..77bcc846 100644 --- a/camlib.py +++ b/camlib.py @@ -2970,7 +2970,7 @@ class CNCjob(Geometry): log.debug("Creating CNC Job from Excellon...") # Tools - + # Sort tools by diameter. items() -> [('name', diameter), ...] sorted_tools = sorted(exobj.tools.items(), key=lambda tl: tl[1]) @@ -2983,7 +2983,7 @@ class CNCjob(Geometry): # Create a sorted list of selected tools from the sorted_tools list tools = [i for i, j in sorted_tools for k in selected_tools if i == k] - log.debug("Tools selected and sorted are: %s" % str(tools)) + log.debug("Tools selected and sorted are: %s" % str(tools)) # Points (Group by tool) points = {} @@ -2994,7 +2994,7 @@ class CNCjob(Geometry): except KeyError: points[drill['tool']] = [drill['point']] - #log.debug("Found %d drills." % len(points)) + # log.debug("Found %d drills." % len(points)) self.gcode = [] # Basic G-Code macros @@ -3016,7 +3016,7 @@ class CNCjob(Geometry): else: gcode += "M03\n" # Spindle start - #gcode += self.pausecode + "\n" + # gcode += self.pausecode + "\n" for tool in tools: @@ -3187,7 +3187,7 @@ class CNCjob(Geometry): log.warning("G-code generation not implemented for %s" % (str(type(geo)))) # Reverse coordinates if not a loop so we can continue - # cutting without returning to the beginhing. + # cutting without returning to the beginning. if type(geo) == LineString: geo.coords = list(geo.coords)[::-1] reverse = True From 3fae21622ad5cb47685915c0927d8b6527701e13 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Sun, 27 May 2018 14:03:19 +0300 Subject: [PATCH 2/3] - allow the usage of lowercase units names (like mm or in) when used in the Tcl command set_sys --- tclCommands/TclCommandSetSys.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tclCommands/TclCommandSetSys.py b/tclCommands/TclCommandSetSys.py index 2f163cce..e880ec05 100644 --- a/tclCommands/TclCommandSetSys.py +++ b/tclCommands/TclCommandSetSys.py @@ -55,7 +55,9 @@ class TclCommandSetSys(TclCommand.TclCommand): "false": False, "False": False, "true": True, - "True": True + "True": True, + "mm": "MM", + "in": "IN" } if param in self.app.defaults: From b85c490256f977812b3fa365c68315b830c18461 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Tue, 29 May 2018 03:46:33 +0300 Subject: [PATCH 3/3] - Tcl shell is no longer loosing focus after entering a command (borrowed from @brainstorm) --- termwidget.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/termwidget.py b/termwidget.py index 538cc161..41433bed 100644 --- a/termwidget.py +++ b/termwidget.py @@ -132,6 +132,7 @@ class TermWidget(QWidget): self._edit.setPlainText("...proccessing... [%s]" % detail) self._edit.setDisabled(True) + self._edit.setFocus() def close_proccessing(self): """ @@ -143,6 +144,7 @@ class TermWidget(QWidget): self._edit.setTextBackgroundColor(Qt.white) self._edit.setPlainText('') self._edit.setDisabled(False) + self._edit.setFocus() def _append_to_browser(self, style, text): """