Merge pull request #9886 from petterreinholdtsen/path-command-lint-fixes-more
Get rid of more lintian complaints from github Python linter.
This commit is contained in:
@@ -40,7 +40,8 @@ from PySide.QtCore import QT_TRANSLATE_NOOP
|
||||
|
||||
LOG_MODULE = Path.Log.thisModule()
|
||||
|
||||
if False:
|
||||
debugmodule = False
|
||||
if debugmodule:
|
||||
Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule())
|
||||
Path.Log.trackModule(Path.Log.thisModule())
|
||||
else:
|
||||
@@ -238,11 +239,11 @@ def resolveFileName(job, subpartname, sequencenumber):
|
||||
fullPath = f"{fn}{n:03d}{ext}"
|
||||
|
||||
if openDialog:
|
||||
foo = QtGui.QFileDialog.getSaveFileName(
|
||||
requestedfile = QtGui.QFileDialog.getSaveFileName(
|
||||
QtGui.QApplication.activeWindow(), "Output File", fullPath
|
||||
)
|
||||
if foo[0]:
|
||||
fullPath = foo[0]
|
||||
fullPath = requestedfile[0]
|
||||
else:
|
||||
fullPath = None
|
||||
|
||||
@@ -308,7 +309,7 @@ def buildPostList(job):
|
||||
if tc is not None and PathUtil.opProperty(obj, "Active"):
|
||||
if tc.ToolNumber != currTool:
|
||||
sublist.append(tc)
|
||||
Path.Log.debug("Appending TC: {}".format(tc.Name))
|
||||
Path.Log.debug(f"Appending TC: {tc.Name}")
|
||||
currTool = tc.ToolNumber
|
||||
sublist.append(obj)
|
||||
postlist.append((f, sublist))
|
||||
@@ -390,7 +391,7 @@ def buildPostList(job):
|
||||
continue
|
||||
|
||||
sublist = []
|
||||
Path.Log.debug("obj: {}".format(obj.Name))
|
||||
Path.Log.debug(f"obj: {obj.Name}")
|
||||
|
||||
for index, f in enumerate(wcslist):
|
||||
sublist.append(fixtureSetup(index, f, job))
|
||||
@@ -405,16 +406,18 @@ def buildPostList(job):
|
||||
if job.SplitOutput:
|
||||
Path.Log.track()
|
||||
return postlist
|
||||
else:
|
||||
Path.Log.track()
|
||||
finalpostlist = [
|
||||
("allitems", [item for slist in postlist for item in slist[1]])
|
||||
]
|
||||
return finalpostlist
|
||||
|
||||
Path.Log.track()
|
||||
finalpostlist = [
|
||||
("allitems", [item for slist in postlist for item in slist[1]])
|
||||
]
|
||||
return finalpostlist
|
||||
|
||||
|
||||
class DlgSelectPostProcessor:
|
||||
def __init__(self, parent=None):
|
||||
"""Provide user with list of available and active post processor
|
||||
choices."""
|
||||
def __init__(self):
|
||||
self.dialog = FreeCADGui.PySideUic.loadUi(":/panels/DlgSelectPostProcessor.ui")
|
||||
firstItem = None
|
||||
for post in Path.Preferences.allEnabledPostProcessors():
|
||||
@@ -499,7 +502,7 @@ class CommandPathPost:
|
||||
postArgs = ""
|
||||
|
||||
if extraargs is not None:
|
||||
postArgs += " {}".format(extraargs)
|
||||
postArgs += f" {extraargs}"
|
||||
|
||||
Path.Log.track(postArgs)
|
||||
|
||||
@@ -552,7 +555,7 @@ class CommandPathPost:
|
||||
if hasattr(o, "Proxy"):
|
||||
if isinstance(o.Proxy, PathJob.ObjectJob):
|
||||
targetlist.append(o.Label)
|
||||
Path.Log.debug("Possible post objects: {}".format(targetlist))
|
||||
Path.Log.debug(f"Possible post objects: {targetlist}")
|
||||
if len(targetlist) > 1:
|
||||
jobname, result = QtGui.QInputDialog.getItem(
|
||||
None, translate("Path", "Choose a Path Job"), None, targetlist
|
||||
@@ -564,7 +567,7 @@ class CommandPathPost:
|
||||
jobname = targetlist[0]
|
||||
job = FreeCAD.ActiveDocument.getObject(jobname)
|
||||
|
||||
Path.Log.debug("about to postprocess job: {}".format(job.Name))
|
||||
Path.Log.debug(f"about to postprocess job: {job.Name}")
|
||||
|
||||
postlist = buildPostList(job)
|
||||
# filename = resolveFileName(job, "allitems", 0)
|
||||
|
||||
Reference in New Issue
Block a user