Consistent black formatting of all Path python files
This commit is contained in:
@@ -26,8 +26,8 @@ import sys
|
||||
|
||||
PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule())
|
||||
|
||||
class PostProcessor:
|
||||
|
||||
class PostProcessor:
|
||||
@classmethod
|
||||
def exists(cls, processor):
|
||||
return processor in PathPreferences.allAvailablePostProcessors()
|
||||
@@ -43,9 +43,9 @@ class PostProcessor:
|
||||
postname = processor + "_post"
|
||||
namespace = {}
|
||||
|
||||
#can't modify function local scope with exec in python3
|
||||
# can't modify function local scope with exec in python3
|
||||
exec("import %s as current_post" % postname, namespace)
|
||||
current_post = namespace['current_post']
|
||||
current_post = namespace["current_post"]
|
||||
|
||||
# make sure the script is reloaded if it was previously loaded
|
||||
# should the script have been imported for the first time above
|
||||
@@ -53,11 +53,12 @@ class PostProcessor:
|
||||
# resulting in 2 load messages if the script outputs one of those.
|
||||
try:
|
||||
# Python 2.7
|
||||
exec("reload(%s)" % 'current_post')
|
||||
exec("reload(%s)" % "current_post")
|
||||
except NameError:
|
||||
# Python 3.4+
|
||||
from importlib import reload
|
||||
exec("reload(%s)" % 'current_post')
|
||||
|
||||
exec("reload(%s)" % "current_post")
|
||||
|
||||
sys.path = syspath
|
||||
|
||||
@@ -72,14 +73,18 @@ class PostProcessor:
|
||||
instance.machineName = current_post.MACHINE_NAME
|
||||
|
||||
if hasattr(current_post, "CORNER_MAX"):
|
||||
instance.cornerMax = {'x': current_post.CORNER_MAX['x'],
|
||||
'y': current_post.CORNER_MAX['y'],
|
||||
'z': current_post.CORNER_MAX['z']}
|
||||
instance.cornerMax = {
|
||||
"x": current_post.CORNER_MAX["x"],
|
||||
"y": current_post.CORNER_MAX["y"],
|
||||
"z": current_post.CORNER_MAX["z"],
|
||||
}
|
||||
|
||||
if hasattr(current_post, "CORNER_MIN"):
|
||||
instance.cornerMin = {'x': current_post.CORNER_MIN['x'],
|
||||
'y': current_post.CORNER_MIN['y'],
|
||||
'z': current_post.CORNER_MIN['z']}
|
||||
instance.cornerMin = {
|
||||
"x": current_post.CORNER_MIN["x"],
|
||||
"y": current_post.CORNER_MIN["y"],
|
||||
"z": current_post.CORNER_MIN["z"],
|
||||
}
|
||||
|
||||
if hasattr(current_post, "TOOLTIP"):
|
||||
instance.tooltip = current_post.TOOLTIP
|
||||
|
||||
Reference in New Issue
Block a user