pylint warnings for PathSelection

This commit is contained in:
Markus Lampert
2019-06-29 23:12:16 -07:00
parent 0a900b3276
commit 3400146d84

View File

@@ -35,22 +35,25 @@ if LOGLEVEL:
PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule())
PathLog.trackModule(PathLog.thisModule())
class PathBaseGate(object):
# pylint: disable=no-init
pass
class EGate:
def allow(self, doc, obj, sub):
class EGate(PathBaseGate):
def allow(self, doc, obj, sub): # pylint: disable=unused-argument
return sub and sub[0:4] == 'Edge'
class MESHGate:
def allow(self, doc, obj, sub):
class MESHGate(PathBaseGate):
def allow(self, doc, obj, sub): # pylint: disable=unused-argument
return obj.TypeId[0:4] == 'Mesh'
class ENGRAVEGate:
def allow(self, doc, obj, sub):
class ENGRAVEGate(PathBaseGate):
def allow(self, doc, obj, sub): # pylint: disable=unused-argument
try:
shape = obj.Shape
except Exception:
except Exception: # pylint: disable=broad-except
return False
if math.fabs(shape.Volume) < 1e-9 and len(shape.Wires) > 0:
@@ -66,11 +69,11 @@ class ENGRAVEGate:
return False
class CHAMFERGate:
def allow(self, doc, obj, sub):
class CHAMFERGate(PathBaseGate):
def allow(self, doc, obj, sub): # pylint: disable=unused-argument
try:
shape = obj.Shape
except Exception:
except Exception: # pylint: disable=broad-except
return False
if math.fabs(shape.Volume) < 1e-9 and len(shape.Wires) > 0:
@@ -88,8 +91,8 @@ class CHAMFERGate:
return False
class DRILLGate:
def allow(self, doc, obj, sub):
class DRILLGate(PathBaseGate):
def allow(self, doc, obj, sub): # pylint: disable=unused-argument
PathLog.debug('obj: {} sub: {}'.format(obj, sub))
if hasattr(obj, "Shape") and sub:
shape = obj.Shape
@@ -99,13 +102,13 @@ class DRILLGate:
return False
class PROFILEGate:
def allow(self, doc, obj, sub):
class PROFILEGate(PathBaseGate):
def allow(self, doc, obj, sub): # pylint: disable=unused-argument
profileable = False
try:
obj = obj.Shape
except Exception:
except Exception: # pylint: disable=broad-except
return False
if obj.ShapeType == 'Edge':
@@ -134,13 +137,13 @@ class PROFILEGate:
return profileable
class POCKETGate:
def allow(self, doc, obj, sub):
class POCKETGate(PathBaseGate):
def allow(self, doc, obj, sub): # pylint: disable=unused-argument
pocketable = False
try:
obj = obj.Shape
except Exception:
except Exception: # pylint: disable=broad-except
return False
if obj.ShapeType == 'Edge':
@@ -159,19 +162,19 @@ class POCKETGate:
return pocketable
class ADAPTIVEGate:
def allow(self, doc, obj, sub):
class ADAPTIVEGate(PathBaseGate):
def allow(self, doc, obj, sub): # pylint: disable=unused-argument
adaptive = True
try:
obj = obj.Shape
except Exception:
except Exception: # pylint: disable=broad-except
return False
return adaptive
class CONTOURGate:
def allow(self, doc, obj, sub):
class CONTOURGate(PathBaseGate):
def allow(self, doc, obj, sub): # pylint: disable=unused-argument
pass
def contourselect():