Addressed pylint warnings for PathPreferences

This commit is contained in:
Markus Lampert
2019-06-30 14:31:34 -07:00
parent 7b7c27ed9b
commit b2ba220c40
4 changed files with 16 additions and 18 deletions

View File

@@ -95,9 +95,13 @@ class PathWorkbench (Workbench):
prepcmdlist.append("Path_Shape")
extracmdlist.extend(["Path_Area", "Path_Area_Workplane"])
threedopcmdlist.append("Path_Surface")
threedcmdgroup = ['Path_3dTools']
FreeCADGui.addCommand('Path_3dTools', PathCommandGroup(threedopcmdlist, QtCore.QT_TRANSLATE_NOOP("Path",'3D Operations')))
try:
import ocl # pylint: disable=unused-variable
threedopcmdlist.append("Path_Surface")
threedcmdgroup = ['Path_3dTools']
FreeCADGui.addCommand('Path_3dTools', PathCommandGroup(threedopcmdlist, QtCore.QT_TRANSLATE_NOOP("Path",'3D Operations')))
except ImportError:
FreeCAD.Console.PrintError("OpenCamLib is not working!\n")
else:
threedcmdgroup = threedopcmdlist

View File

@@ -118,10 +118,10 @@ def defaultJobTemplate():
return template
return ''
def setJobDefaults(filePath, jobTemplate, geometryTolerance, curveAccuracy):
PathLog.track("(%s='%s', %s, %s, %s)" % (DefaultFilePath, filePath, jobTemplate, geometryTolerance, curveAccuracy))
def setJobDefaults(fileName, jobTemplate, geometryTolerance, curveAccuracy):
PathLog.track("(%s='%s', %s, %s, %s)" % (DefaultFilePath, fileName, jobTemplate, geometryTolerance, curveAccuracy))
pref = preferences()
pref.SetString(DefaultFilePath, filePath)
pref.SetString(DefaultFilePath, fileName)
pref.SetString(DefaultJobTemplate, jobTemplate)
pref.SetFloat(GeometryTolerance, geometryTolerance)
pref.SetFloat(LibAreaCurveAccuracy, curveAccuracy)
@@ -131,7 +131,7 @@ def postProcessorBlacklist():
blacklist = pref.GetString(PostProcessorBlacklist, "")
if not blacklist:
return []
return eval(blacklist)
return eval(blacklist) # pylint: disable=eval-used
def setPostProcessorDefaults(processor, args, blacklist):
pref = preferences()
@@ -140,9 +140,9 @@ def setPostProcessorDefaults(processor, args, blacklist):
pref.SetString(PostProcessorBlacklist, "%s" % (blacklist))
def setOutputFileDefaults(file, policy):
def setOutputFileDefaults(fileName, policy):
pref = preferences()
pref.SetString(PostProcessorOutputFile, file)
pref.SetString(PostProcessorOutputFile, fileName)
pref.SetString(PostProcessorOutputPolicy, policy)
def defaultOutputFile():
@@ -164,9 +164,4 @@ def setDefaultTaskPanelLayout(style):
preferences().SetInt(DefaultTaskPanelLayout, style)
def experimentalFeaturesEnabled():
try:
import ocl
return preferences().GetBool(EnableExperimentalFeatures, False)
except ImportError:
FreeCAD.Console.PrintError("OpenCamLib is not working!\n")
return False
return preferences().GetBool(EnableExperimentalFeatures, False)

View File

@@ -22,9 +22,6 @@
# * *
# ***************************************************************************
import FreeCAD
import PathScripts.PathPreferences as PathPreferences
from PySide import QtCore, QtGui
# Qt translation handling
@@ -38,6 +35,7 @@ def RegisterDressup(dressup):
class DressupPreferencesPage:
def __init__(self, parent=None):
# pylint: disable=unused-argument
self.form = QtGui.QToolBox()
self.form.setWindowTitle(translate("Path_PreferencesPathDressup", 'Dressups'))
pages = []

View File

@@ -39,6 +39,7 @@ PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule())
class JobPreferencesPage:
def __init__(self, parent=None):
# pylint: disable=unused-argument
import FreeCADGui
self.form = FreeCADGui.PySideUic.loadUi(":preferences/PathJob.ui")
self.form.toolBox.setCurrentIndex(0) # Take that qt designer!