mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
♻️ refactor support feature check function name
This commit is contained in:
parent
dfd8fe6e8c
commit
fa8c054889
5 changed files with 14 additions and 14 deletions
|
|
@ -32,7 +32,7 @@ from ayon_core.host import IPublishHost, IWorkfileHost
|
|||
from ayon_core.pipeline import Anatomy
|
||||
from ayon_core.pipeline.template_data import get_template_data
|
||||
from ayon_core.pipeline.plugin_discover import DiscoverResult
|
||||
from ayon_core.pipeline.compatibility import is_supporting_product_base_type
|
||||
from ayon_core.pipeline.compatibility import is_product_base_type_supported
|
||||
|
||||
from .exceptions import (
|
||||
CreatorError,
|
||||
|
|
@ -1199,7 +1199,7 @@ class CreateContext:
|
|||
# Add product base type if supported.
|
||||
# TODO (antirotor): Once all creators support product base type
|
||||
# remove this check.
|
||||
if is_supporting_product_base_type():
|
||||
if is_product_base_type_supported():
|
||||
|
||||
if hasattr(creator, "product_base_type"):
|
||||
instance_data["productBaseType"] = creator.product_base_type
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from typing import TYPE_CHECKING, Any, Dict, Optional
|
|||
from warnings import warn
|
||||
|
||||
from ayon_core.lib import Logger, get_version_from_path
|
||||
from ayon_core.pipeline.compatibility import is_supporting_product_base_type
|
||||
from ayon_core.pipeline.compatibility import is_product_base_type_supported
|
||||
from ayon_core.pipeline.plugin_discover import (
|
||||
deregister_plugin,
|
||||
deregister_plugin_path,
|
||||
|
|
@ -296,7 +296,7 @@ class BaseCreator(ABC):
|
|||
|
||||
"""
|
||||
identifier = self.product_type
|
||||
if is_supporting_product_base_type():
|
||||
if is_product_base_type_supported():
|
||||
identifier = self.product_base_type
|
||||
if self.product_type:
|
||||
identifier = f"{identifier}.{self.product_type}"
|
||||
|
|
@ -402,7 +402,7 @@ class BaseCreator(ABC):
|
|||
product_type = self.product_type
|
||||
|
||||
if (
|
||||
is_supporting_product_base_type()
|
||||
is_product_base_type_supported()
|
||||
and not product_base_type
|
||||
and not self.product_base_type
|
||||
):
|
||||
|
|
@ -557,7 +557,7 @@ class BaseCreator(ABC):
|
|||
product_base_type (Optional[str]): Product base type.
|
||||
|
||||
"""
|
||||
if is_supporting_product_base_type() and (instance and hasattr(instance, "product_base_type")): # noqa: E501
|
||||
if is_product_base_type_supported() and (instance and hasattr(instance, "product_base_type")): # noqa: E501
|
||||
product_base_type = instance.product_base_type
|
||||
|
||||
if host_name is None:
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ from ayon_core.lib import (
|
|||
filter_profiles,
|
||||
prepare_template_data,
|
||||
)
|
||||
from ayon_core.pipeline.compatibility import is_supporting_product_base_type
|
||||
from ayon_core.pipeline.compatibility import is_product_base_type_supported
|
||||
from ayon_core.settings import get_project_settings
|
||||
|
||||
from .constants import DEFAULT_PRODUCT_TEMPLATE
|
||||
|
|
@ -58,7 +58,7 @@ def get_product_name_template(
|
|||
"task_types": task_type
|
||||
}
|
||||
|
||||
if is_supporting_product_base_type():
|
||||
if is_product_base_type_supported():
|
||||
if product_base_type:
|
||||
filtering_criteria["product_base_types"] = product_base_type
|
||||
else:
|
||||
|
|
@ -193,7 +193,7 @@ def get_product_name(
|
|||
# look what we have to do to make mypy happy. We should stop using
|
||||
# those undefined dict based types.
|
||||
product: dict[str, str] = {"type": product_type}
|
||||
if is_supporting_product_base_type():
|
||||
if is_product_base_type_supported():
|
||||
if product_base_type:
|
||||
product["baseType"] = product_base_type
|
||||
elif "{product[basetype]}" in template.lower():
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ from ayon_core.lib.attribute_definitions import (
|
|||
deserialize_attr_defs,
|
||||
)
|
||||
|
||||
from ayon_core.pipeline.compatibility import is_supporting_product_base_type
|
||||
from ayon_core.pipeline.compatibility import is_product_base_type_supported
|
||||
|
||||
from ayon_core.pipeline import (
|
||||
AYON_INSTANCE_ID,
|
||||
|
|
@ -502,7 +502,7 @@ class CreatedInstance:
|
|||
product_base_type: Optional[str] = None
|
||||
):
|
||||
"""Initialize CreatedInstance."""
|
||||
if is_supporting_product_base_type():
|
||||
if is_product_base_type_supported():
|
||||
if not hasattr(creator, "product_base_type"):
|
||||
warn(
|
||||
f"Provided creator {creator!r} doesn't have "
|
||||
|
|
@ -564,7 +564,7 @@ class CreatedInstance:
|
|||
self._data["productType"] = product_type
|
||||
self._data["productName"] = product_name
|
||||
|
||||
if is_supporting_product_base_type():
|
||||
if is_product_base_type_supported():
|
||||
data.pop("productBaseType", None)
|
||||
self._data["productBaseType"] = product_base_type
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ from ayon_core.pipeline.create import (
|
|||
ConvertorsOperationFailed,
|
||||
ConvertorItem,
|
||||
)
|
||||
from ayon_core.pipeline.compatibility import is_supporting_product_base_type
|
||||
from ayon_core.pipeline.compatibility import is_product_base_type_supported
|
||||
|
||||
from ayon_core.tools.publisher.abstract import (
|
||||
AbstractPublisherBackend,
|
||||
|
|
@ -634,7 +634,7 @@ class CreateModel:
|
|||
"project_entity": project_entity,
|
||||
}
|
||||
|
||||
if is_supporting_product_base_type() and hasattr(creator, "product_base_type"): # noqa: E501
|
||||
if is_product_base_type_supported() and hasattr(creator, "product_base_type"): # noqa: E501
|
||||
kwargs["product_base_type"] = creator.product_base_type
|
||||
|
||||
# Backwards compatibility for 'project_entity' argument
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue