update code style

This commit is contained in:
Mustafa-Zarkash 2023-07-06 12:09:57 +03:00
parent 6e2fa0299e
commit 3f5d99e833

View file

@ -46,7 +46,7 @@ class ValidatePrimitiveHierarchyPaths(pyblish.api.InstancePlugin):
if output_node is None:
cls.log.error(
"SOP Output node in '%s' does not exist. "
"Ensure a valid SOP output path is set." % rop_node.path()
"Ensure a valid SOP output path is set.", rop_node.path()
)
return [rop_node]
@ -68,7 +68,7 @@ class ValidatePrimitiveHierarchyPaths(pyblish.api.InstancePlugin):
)
return [rop_node]
cls.log.debug("Checking for attribute: %s" % path_attr)
cls.log.debug("Checking for attribute: %s", path_attr)
# Check if the primitive attribute exists
frame = instance.data.get("frameStart", 0)
@ -91,7 +91,7 @@ class ValidatePrimitiveHierarchyPaths(pyblish.api.InstancePlugin):
if not attrib:
cls.log.info(
"Geometry Primitives are missing "
"path attribute: `%s`" % path_attr
"path attribute: `%s`", path_attr
)
return [output_node]
@ -99,7 +99,7 @@ class ValidatePrimitiveHierarchyPaths(pyblish.api.InstancePlugin):
if not attrib.strings():
cls.log.info(
"Primitive path attribute has no "
"string values: %s" % path_attr
"string values: %s", path_attr
)
return [output_node]
@ -111,7 +111,7 @@ class ValidatePrimitiveHierarchyPaths(pyblish.api.InstancePlugin):
num_prims = len(geo.iterPrims()) # faster than len(geo.prims())
cls.log.info(
"Prims have no value for attribute `%s` "
"(%s of %s prims)" % (path_attr, len(invalid_prims), num_prims)
"(%s of %s prims)", path_attr, len(invalid_prims), num_prims
)
return [output_node]
@ -119,17 +119,17 @@ class ValidatePrimitiveHierarchyPaths(pyblish.api.InstancePlugin):
def repair(cls, instance):
"""Add a default path attribute Action.
it's a helper action more than a repair action,
which used to add a default single value.
It is a helper action more than a repair action,
used to add a default single value for the path.
"""
rop_node = hou.node(instance.data["instance_node"])
output_node = rop_node.parm('sop_path').evalAsNode()
output_node = rop_node.parm("sop_path").evalAsNode()
if not output_node:
cls.log.debug(
"Action isn't performed, empty SOP Path on %s"
% rop_node
"Action isn't performed, invalid SOP Path on %s",
rop_node
)
return
@ -146,8 +146,8 @@ class ValidatePrimitiveHierarchyPaths(pyblish.api.InstancePlugin):
path_node.parm("name1").set('`opname("..")`/`opname("..")`Shape')
cls.log.debug(
"'%s' was created. It adds '%s' with a default single value"
% (path_node, path_attr)
"'%s' was created. It adds '%s' with a default single value",
path_node, path_attr
)
path_node.setGenericFlag(hou.nodeFlag.DisplayComment,True)
@ -156,7 +156,7 @@ class ValidatePrimitiveHierarchyPaths(pyblish.api.InstancePlugin):
'\nFeel free to modify or replace it.'
)
if output_node.type().name() in ['null', 'output']:
if output_node.type().name() in ["null", "output"]:
# Connect before
path_node.setFirstInput(output_node.input(0))
path_node.moveToGoodPosition()
@ -165,10 +165,10 @@ class ValidatePrimitiveHierarchyPaths(pyblish.api.InstancePlugin):
else:
# Connect after
path_node.setFirstInput(output_node)
rop_node.parm('sop_path').set(path_node.path())
rop_node.parm("sop_path").set(path_node.path())
path_node.moveToGoodPosition()
cls.log.debug(
"SOP path on '%s' updated to new output node '%s'"
% (rop_node, path_node)
"SOP path on '%s' updated to new output node '%s'",
rop_node, path_node
)