- in Tools Database added a contextual menu to add/copy/delete tool; CTRL+C, DEL keys work too; key T for adding a tool is now only partially working

- in Tools Database made the status bar messages show when adding/copying/deleting tools in DB
- changed all Except statements that were single to except Exception as recommended in some PEP
- renamed the Copper Fill Tool to Copper Thieving Tool as this is a more appropriate name; started to add ability for more types of copper thieving besides solid
- fixed some issues recently introduced in ParseSVG
- updated POT file
This commit is contained in:
Marius Stanciu
2019-11-11 02:35:42 +02:00
committed by Marius
parent fdad91f04e
commit 70d123306c
33 changed files with 8161 additions and 5603 deletions

View File

@@ -241,7 +241,7 @@ def dxfsolid2shapely(solid):
try:
corner_list.append(solid[iterator])
iterator += 1
except:
except Exception:
return Polygon(corner_list)
@@ -265,7 +265,7 @@ def dxftrace2shapely(trace):
try:
corner_list.append(trace[iterator])
iterator += 1
except:
except Exception:
return Polygon(corner_list)

View File

@@ -250,7 +250,7 @@ class Excellon(Geometry):
try:
self.parse_lines(estr)
except:
except Exception:
return "fail"
def parse_lines(self, elines):
@@ -412,7 +412,7 @@ class Excellon(Geometry):
name = str(int(match.group(1)))
try:
diam = float(match.group(2))
except:
except Exception:
# it's possible that tool definition has only tool number and no diameter info
# (those could be in another file like PCB Wizard do)
# then match.group(2) = None and float(None) will create the exception
@@ -476,7 +476,7 @@ class Excellon(Geometry):
slot_current_x = slot_start_x
except TypeError:
slot_start_x = slot_current_x
except:
except Exception:
return
try:
@@ -484,7 +484,7 @@ class Excellon(Geometry):
slot_current_y = slot_start_y
except TypeError:
slot_start_y = slot_current_y
except:
except Exception:
return
try:
@@ -492,7 +492,7 @@ class Excellon(Geometry):
slot_current_x = slot_stop_x
except TypeError:
slot_stop_x = slot_current_x
except:
except Exception:
return
try:
@@ -500,7 +500,7 @@ class Excellon(Geometry):
slot_current_y = slot_stop_y
except TypeError:
slot_stop_y = slot_current_y
except:
except Exception:
return
if (slot_start_x is None or slot_start_y is None or
@@ -546,7 +546,7 @@ class Excellon(Geometry):
slot_current_x = slot_start_x
except TypeError:
slot_start_x = slot_current_x
except:
except Exception:
return
try:
@@ -554,7 +554,7 @@ class Excellon(Geometry):
slot_current_y = slot_start_y
except TypeError:
slot_start_y = slot_current_y
except:
except Exception:
return
try:
@@ -562,7 +562,7 @@ class Excellon(Geometry):
slot_current_x = slot_stop_x
except TypeError:
slot_stop_x = slot_current_x
except:
except Exception:
return
try:
@@ -570,7 +570,7 @@ class Excellon(Geometry):
slot_current_y = slot_stop_y
except TypeError:
slot_stop_y = slot_current_y
except:
except Exception:
return
if (slot_start_x is None or slot_start_y is None or
@@ -619,7 +619,7 @@ class Excellon(Geometry):
except TypeError:
x = current_x
repeating_x = 0
except:
except Exception:
return
try:
@@ -629,7 +629,7 @@ class Excellon(Geometry):
except TypeError:
y = current_y
repeating_y = 0
except:
except Exception:
return
if x is None or y is None:

View File

@@ -258,7 +258,7 @@ class Gerber(Geometry):
try: # Could be empty for aperture macros
paramList = apParameters.split('X')
except:
except Exception:
paramList = None
if apertureType == "C": # Circle, example: %ADD11C,0.1*%
@@ -867,7 +867,7 @@ class Gerber(Geometry):
# if match.group(1) is None and match.group(2) is None and match.group(3) is None:
# try:
# current_operation_code = int(match.group(4))
# except:
# except Exception:
# pass # A line with just * will match too.
# continue
# NOTE: Letting it continue allows it to react to the
@@ -1082,7 +1082,7 @@ class Gerber(Geometry):
geo_dict['clear'] = geo_s
else:
geo_dict['solid'] = geo_s
except:
except Exception:
if self.app.defaults['gerber_simplification']:
poly_buffer.append(geo_s.simplify(s_tol))
else:
@@ -1434,7 +1434,7 @@ class Gerber(Geometry):
# for poly in new_poly:
# try:
# self.solid_geometry = self.solid_geometry.union(poly)
# except:
# except Exception:
# pass
else:
self.solid_geometry = self.solid_geometry.difference(new_poly)
@@ -1661,7 +1661,7 @@ class Gerber(Geometry):
try:
xfactor = float(xfactor)
except:
except Exception:
self.app.inform.emit('[ERROR_NOTCL] %s' %
_("Scale factor has to be a number: integer or float."))
return
@@ -1671,7 +1671,7 @@ class Gerber(Geometry):
else:
try:
yfactor = float(yfactor)
except:
except Exception:
self.app.inform.emit('[ERROR_NOTCL] %s' %
_("Scale factor has to be a number: integer or float."))
return

View File

@@ -125,7 +125,7 @@ def path2shapely(path, object_type, res=1.0):
rings = MultiLineString(rings)
if len(rings) > 0:
if len(rings) == 1:
if len(rings) == 1 and not isinstance(rings, MultiLineString):
# Polygons are closed and require more than 2 points
if Point(rings[0][0]).almost_equals(Point(rings[0][-1])) and len(rings[0]) > 2:
geo_element = Polygon(rings[0])
@@ -134,7 +134,7 @@ def path2shapely(path, object_type, res=1.0):
else:
try:
geo_element = Polygon(rings[0], rings[1:])
except Exception as e:
except Exception:
coords = list()
for line in rings:
coords.append(line.coords[0])