mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
use validations from interfaces
This commit is contained in:
parent
0ff8e2bcc6
commit
b81dbf9ee4
4 changed files with 17 additions and 43 deletions
|
|
@ -6,6 +6,7 @@ import inspect
|
|||
from uuid import uuid4
|
||||
from contextlib import contextmanager
|
||||
|
||||
from openpype.host import INewPublisher
|
||||
from openpype.pipeline import legacy_io
|
||||
from openpype.pipeline.mongodb import (
|
||||
AvalonMongoDB,
|
||||
|
|
@ -651,12 +652,6 @@ class CreateContext:
|
|||
discover_publish_plugins(bool): Discover publish plugins during reset
|
||||
phase.
|
||||
"""
|
||||
# Methods required in host implementaion to be able create instances
|
||||
# or change context data.
|
||||
required_methods = (
|
||||
"get_context_data",
|
||||
"update_context_data"
|
||||
)
|
||||
|
||||
def __init__(
|
||||
self, host, dbcon=None, headless=False, reset=True,
|
||||
|
|
@ -738,10 +733,10 @@ class CreateContext:
|
|||
Args:
|
||||
host(ModuleType): Host implementaion.
|
||||
"""
|
||||
missing = set()
|
||||
for attr_name in cls.required_methods:
|
||||
if not hasattr(host, attr_name):
|
||||
missing.add(attr_name)
|
||||
|
||||
missing = set(
|
||||
INewPublisher.get_missing_publish_methods(host)
|
||||
)
|
||||
return missing
|
||||
|
||||
@property
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue