Skip to content

Commit

Permalink
pylint warnings for PathSelection
Browse files Browse the repository at this point in the history
  • Loading branch information
mlampert committed Jul 1, 2019
1 parent 80e991a commit c870d33
Showing 1 changed file with 26 additions and 23 deletions.
49 changes: 26 additions & 23 deletions src/Mod/Path/PathScripts/PathSelection.py
Expand Up @@ -35,22 +35,25 @@
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:
Expand All @@ -66,11 +69,11 @@ def allow(self, doc, obj, sub):

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:
Expand All @@ -88,8 +91,8 @@ def allow(self, doc, obj, sub):
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
Expand All @@ -99,13 +102,13 @@ def allow(self, doc, obj, sub):
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':
Expand Down Expand Up @@ -134,13 +137,13 @@ def allow(self, doc, obj, sub):
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':
Expand All @@ -159,19 +162,19 @@ def allow(self, doc, obj, sub):

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():
Expand Down

0 comments on commit c870d33

Please sign in to comment.