From 008afb3ca8dc29e612065a583fa16e857834608b Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Mon, 20 May 2019 16:36:13 +0300 Subject: [PATCH] - more PEP8 changes in Gerber editor --- README.md | 4 ++++ flatcamEditors/FlatCAMGrbEditor.py | 29 ++++++++++++++++------------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 7471238f..0bf2cb41 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,10 @@ CAD program, and create G-Code for Isolation routing. ================================================= +20.05.2019 + +- more PEP8 changes in Gerber editor + 19.05.2019 - fixed the Circle Steps parameter for both Gerber and Geometry objects not being applied and instead the app internal defaults were used. diff --git a/flatcamEditors/FlatCAMGrbEditor.py b/flatcamEditors/FlatCAMGrbEditor.py index 4d00d320..32ba76b6 100644 --- a/flatcamEditors/FlatCAMGrbEditor.py +++ b/flatcamEditors/FlatCAMGrbEditor.py @@ -82,7 +82,7 @@ class DrawToolShape(object): return return pts - def __init__(self, geo={}): + def __init__(self, geo=None): # Shapely type or list of such self.geo = geo @@ -525,11 +525,13 @@ class FCPadArray(FCShapeTool): new_geo_el = dict() if 'solid' in geo_el: - new_geo_el['solid'] = affinity.translate(geo_el['solid'], xoff=(dx - self.last_dx), - yoff=(dy - self.last_dy)) + new_geo_el['solid'] = affinity.translate( + geo_el['solid'], xoff=(dx - self.last_dx), yoff=(dy - self.last_dy) + ) if 'follow' in geo_el: - new_geo_el['follow'] = affinity.translate(geo_el['solid'], xoff=(dx - self.last_dx), - yoff=(dy - self.last_dy)) + new_geo_el['follow'] = affinity.translate( + geo_el['solid'], xoff=(dx - self.last_dx), yoff=(dy - self.last_dy) + ) geo_el_list.append(new_geo_el) else: @@ -582,7 +584,7 @@ class FCPadArray(FCShapeTool): center = Point([point_x, point_y]) new_geo_el['solid'] = center.buffer(self.radius) new_geo_el['follow'] = center - return new_geo_el + return new_geo_el elif ap_type == 'R': new_geo_el = dict() @@ -590,9 +592,9 @@ class FCPadArray(FCShapeTool): p2 = (point_x + self.half_width, point_y - self.half_height) p3 = (point_x + self.half_width, point_y + self.half_height) p4 = (point_x - self.half_width, point_y + self.half_height) - new_geo_el['solid'] = Polygon([p1, p2, p3, p4, p1]) + new_geo_el['solid'] = Polygon([p1, p2, p3, p4, p1]) new_geo_el['follow'] = Point([point_x, point_y]) - return new_geo_el + return new_geo_el elif ap_type == 'O': geo = [] new_geo_el = dict() @@ -725,7 +727,7 @@ class FCPoligonize(FCShapeTool): self.name = 'poligonize' self.draw_app = draw_app - self.draw_app.app.inform.emit( _("Select shape(s) and then click ...")) + self.draw_app.app.inform.emit(_("Select shape(s) and then click ...")) self.draw_app.in_action = True self.make() @@ -748,7 +750,7 @@ class FCPoligonize(FCShapeTool): apid_set.add(apid) break - if len (apid_set) > 1: + if len(apid_set) > 1: self.draw_app.in_action = False self.complete = True self.draw_app.app.inform.emit(_("[WARNING_NOTCL] Failed. Poligonize works only on " @@ -849,8 +851,9 @@ class FCRegion(FCShapeTool): try: QtGui.QGuiApplication.restoreOverrideCursor() - except: - pass + except Exception as e: + log.debug("FlatCAMGrbEditor.FCRegion --> %s" % str(e)) + self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero.png')) QtGui.QGuiApplication.setOverrideCursor(self.cursor) @@ -1863,7 +1866,7 @@ class FCApertureMove(FCShapeTool): self.geometry.append(DrawToolShape(new_geo_el)) self.current_storage.remove(select_shape) sel_shapes_to_be_deleted.append(select_shape) - self.draw_app.on_grb_shape_complete(self.current_storage, noplot=True) + self.draw_app.on_grb_shape_complete(self.current_storage, no_plot=True) self.geometry = [] for shp in sel_shapes_to_be_deleted: