mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-03 01:14:54 +01:00
Move single use of in-line function to the class for readability
This commit is contained in:
parent
8af88e1157
commit
e8aa926cb7
1 changed files with 20 additions and 19 deletions
|
|
@ -544,26 +544,8 @@ class AbstractSubmitDeadline(pyblish.api.InstancePlugin):
|
|||
|
||||
"""
|
||||
|
||||
def _get_workfile_instance(context):
|
||||
"""Find workfile instance in context"""
|
||||
for i in context:
|
||||
|
||||
is_workfile = (
|
||||
"workfile" in i.data.get("families", []) or
|
||||
i.data["family"] == "workfile"
|
||||
)
|
||||
if not is_workfile:
|
||||
continue
|
||||
|
||||
# test if there is instance of workfile waiting
|
||||
# to be published.
|
||||
assert i.data["publish"] is True, (
|
||||
"Workfile (scene) must be published along")
|
||||
|
||||
return i
|
||||
|
||||
instance = self._instance
|
||||
workfile_instance = _get_workfile_instance(instance.context)
|
||||
workfile_instance = self._get_workfile_instance(instance.context)
|
||||
if not workfile_instance:
|
||||
return
|
||||
|
||||
|
|
@ -689,3 +671,22 @@ class AbstractSubmitDeadline(pyblish.api.InstancePlugin):
|
|||
self._instance.data["deadlineSubmissionJob"] = result
|
||||
|
||||
return result["_id"]
|
||||
|
||||
@staticmethod
|
||||
def _get_workfile_instance(context):
|
||||
"""Find workfile instance in context"""
|
||||
for i in context:
|
||||
|
||||
is_workfile = (
|
||||
"workfile" in i.data.get("families", []) or
|
||||
i.data["family"] == "workfile"
|
||||
)
|
||||
if not is_workfile:
|
||||
continue
|
||||
|
||||
# test if there is instance of workfile waiting
|
||||
# to be published.
|
||||
assert i.data["publish"] is True, (
|
||||
"Workfile (scene) must be published along")
|
||||
|
||||
return i
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue