mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
fix typo 'AbtractAttrDef' to 'AbstractAttrDef'
This commit is contained in:
parent
36df58aba1
commit
d48b73ed61
9 changed files with 34 additions and 34 deletions
|
|
@ -30,7 +30,7 @@ from .vendor_bin_utils import (
|
|||
)
|
||||
|
||||
from .attribute_definitions import (
|
||||
AbtractAttrDef,
|
||||
AbstractAttrDef,
|
||||
|
||||
UIDef,
|
||||
UISeparatorDef,
|
||||
|
|
@ -246,7 +246,7 @@ __all__ = [
|
|||
"get_ffmpeg_tool_path",
|
||||
"is_oiio_supported",
|
||||
|
||||
"AbtractAttrDef",
|
||||
"AbstractAttrDef",
|
||||
|
||||
"UIDef",
|
||||
"UISeparatorDef",
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ def register_attr_def_class(cls):
|
|||
Currently are registered definitions used to deserialize data to objects.
|
||||
|
||||
Attrs:
|
||||
cls (AbtractAttrDef): Non-abstract class to be registered with unique
|
||||
cls (AbstractAttrDef): Non-abstract class to be registered with unique
|
||||
'type' attribute.
|
||||
|
||||
Raises:
|
||||
|
|
@ -36,7 +36,7 @@ def get_attributes_keys(attribute_definitions):
|
|||
"""Collect keys from list of attribute definitions.
|
||||
|
||||
Args:
|
||||
attribute_definitions (List[AbtractAttrDef]): Objects of attribute
|
||||
attribute_definitions (List[AbstractAttrDef]): Objects of attribute
|
||||
definitions.
|
||||
|
||||
Returns:
|
||||
|
|
@ -57,7 +57,7 @@ def get_default_values(attribute_definitions):
|
|||
"""Receive default values for attribute definitions.
|
||||
|
||||
Args:
|
||||
attribute_definitions (List[AbtractAttrDef]): Attribute definitions for
|
||||
attribute_definitions (List[AbstractAttrDef]): Attribute definitions for
|
||||
which default values should be collected.
|
||||
|
||||
Returns:
|
||||
|
|
@ -76,15 +76,15 @@ def get_default_values(attribute_definitions):
|
|||
|
||||
|
||||
class AbstractAttrDefMeta(ABCMeta):
|
||||
"""Meta class to validate existence of 'key' attribute.
|
||||
"""Metaclass to validate existence of 'key' attribute.
|
||||
|
||||
Each object of `AbtractAttrDef` mus have defined 'key' attribute.
|
||||
Each object of `AbstractAttrDef` mus have defined 'key' attribute.
|
||||
"""
|
||||
|
||||
def __call__(self, *args, **kwargs):
|
||||
obj = super(AbstractAttrDefMeta, self).__call__(*args, **kwargs)
|
||||
init_class = getattr(obj, "__init__class__", None)
|
||||
if init_class is not AbtractAttrDef:
|
||||
if init_class is not AbstractAttrDef:
|
||||
raise TypeError("{} super was not called in __init__.".format(
|
||||
type(obj)
|
||||
))
|
||||
|
|
@ -92,7 +92,7 @@ class AbstractAttrDefMeta(ABCMeta):
|
|||
|
||||
|
||||
@six.add_metaclass(AbstractAttrDefMeta)
|
||||
class AbtractAttrDef(object):
|
||||
class AbstractAttrDef(object):
|
||||
"""Abstraction of attribute definiton.
|
||||
|
||||
Each attribute definition must have implemented validation and
|
||||
|
|
@ -145,7 +145,7 @@ class AbtractAttrDef(object):
|
|||
self.disabled = disabled
|
||||
self._id = uuid.uuid4().hex
|
||||
|
||||
self.__init__class__ = AbtractAttrDef
|
||||
self.__init__class__ = AbstractAttrDef
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
|
|
@ -220,7 +220,7 @@ class AbtractAttrDef(object):
|
|||
# UI attribute definitoins won't hold value
|
||||
# -----------------------------------------
|
||||
|
||||
class UIDef(AbtractAttrDef):
|
||||
class UIDef(AbstractAttrDef):
|
||||
is_value_def = False
|
||||
|
||||
def __init__(self, key=None, default=None, *args, **kwargs):
|
||||
|
|
@ -245,7 +245,7 @@ class UILabelDef(UIDef):
|
|||
# Attribute defintioins should hold value
|
||||
# ---------------------------------------
|
||||
|
||||
class UnknownDef(AbtractAttrDef):
|
||||
class UnknownDef(AbstractAttrDef):
|
||||
"""Definition is not known because definition is not available.
|
||||
|
||||
This attribute can be used to keep existing data unchanged but does not
|
||||
|
|
@ -262,7 +262,7 @@ class UnknownDef(AbtractAttrDef):
|
|||
return value
|
||||
|
||||
|
||||
class HiddenDef(AbtractAttrDef):
|
||||
class HiddenDef(AbstractAttrDef):
|
||||
"""Hidden value of Any type.
|
||||
|
||||
This attribute can be used for UI purposes to pass values related
|
||||
|
|
@ -282,7 +282,7 @@ class HiddenDef(AbtractAttrDef):
|
|||
return value
|
||||
|
||||
|
||||
class NumberDef(AbtractAttrDef):
|
||||
class NumberDef(AbstractAttrDef):
|
||||
"""Number definition.
|
||||
|
||||
Number can have defined minimum/maximum value and decimal points. Value
|
||||
|
|
@ -358,7 +358,7 @@ class NumberDef(AbtractAttrDef):
|
|||
return round(float(value), self.decimals)
|
||||
|
||||
|
||||
class TextDef(AbtractAttrDef):
|
||||
class TextDef(AbstractAttrDef):
|
||||
"""Text definition.
|
||||
|
||||
Text can have multiline option so endline characters are allowed regex
|
||||
|
|
@ -423,7 +423,7 @@ class TextDef(AbtractAttrDef):
|
|||
return data
|
||||
|
||||
|
||||
class EnumDef(AbtractAttrDef):
|
||||
class EnumDef(AbstractAttrDef):
|
||||
"""Enumeration of single item from items.
|
||||
|
||||
Args:
|
||||
|
|
@ -531,7 +531,7 @@ class EnumDef(AbtractAttrDef):
|
|||
|
||||
return output
|
||||
|
||||
class BoolDef(AbtractAttrDef):
|
||||
class BoolDef(AbstractAttrDef):
|
||||
"""Boolean representation.
|
||||
|
||||
Args:
|
||||
|
|
@ -776,7 +776,7 @@ class FileDefItem(object):
|
|||
return output
|
||||
|
||||
|
||||
class FileDef(AbtractAttrDef):
|
||||
class FileDef(AbstractAttrDef):
|
||||
"""File definition.
|
||||
It is possible to define filters of allowed file extensions and if supports
|
||||
folders.
|
||||
|
|
@ -894,7 +894,7 @@ def serialize_attr_def(attr_def):
|
|||
"""Serialize attribute definition to data.
|
||||
|
||||
Args:
|
||||
attr_def (AbtractAttrDef): Attribute definition to serialize.
|
||||
attr_def (AbstractAttrDef): Attribute definition to serialize.
|
||||
|
||||
Returns:
|
||||
Dict[str, Any]: Serialized data.
|
||||
|
|
@ -907,7 +907,7 @@ def serialize_attr_defs(attr_defs):
|
|||
"""Serialize attribute definitions to data.
|
||||
|
||||
Args:
|
||||
attr_defs (List[AbtractAttrDef]): Attribute definitions to serialize.
|
||||
attr_defs (List[AbstractAttrDef]): Attribute definitions to serialize.
|
||||
|
||||
Returns:
|
||||
List[Dict[str, Any]]: Serialized data.
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ class AttributeValues(object):
|
|||
Has dictionary like methods. Not all of them are allowed all the time.
|
||||
|
||||
Args:
|
||||
attr_defs(AbtractAttrDef): Defintions of value type and properties.
|
||||
attr_defs(AbstractAttrDef): Defintions of value type and properties.
|
||||
values(dict): Values after possible conversion.
|
||||
origin_data(dict): Values loaded from host before conversion.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -425,7 +425,7 @@ class BaseCreator:
|
|||
keys/values when plugin attributes change.
|
||||
|
||||
Returns:
|
||||
List[AbtractAttrDef]: Attribute definitions that can be tweaked for
|
||||
List[AbstractAttrDef]: Attribute definitions that can be tweaked for
|
||||
created instance.
|
||||
"""
|
||||
|
||||
|
|
@ -563,7 +563,7 @@ class Creator(BaseCreator):
|
|||
updating keys/values when plugin attributes change.
|
||||
|
||||
Returns:
|
||||
List[AbtractAttrDef]: Attribute definitions that can be tweaked for
|
||||
List[AbstractAttrDef]: Attribute definitions that can be tweaked for
|
||||
created instance.
|
||||
"""
|
||||
return self.pre_create_attr_defs
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ class OpenPypePyblishPluginMixin:
|
|||
|
||||
Attributes available for all families in plugin's `families` attribute.
|
||||
Returns:
|
||||
list<AbtractAttrDef>: Attribute definitions for plugin.
|
||||
list<AbstractAttrDef>: Attribute definitions for plugin.
|
||||
"""
|
||||
|
||||
return []
|
||||
|
|
|
|||
|
|
@ -842,7 +842,7 @@ class PlaceholderPlugin(object):
|
|||
"""Placeholder options for data showed.
|
||||
|
||||
Returns:
|
||||
List[AbtractAttrDef]: Attribute definitions of placeholder options.
|
||||
List[AbstractAttrDef]: Attribute definitions of placeholder options.
|
||||
"""
|
||||
|
||||
return []
|
||||
|
|
@ -1143,7 +1143,7 @@ class PlaceholderLoadMixin(object):
|
|||
as defaults for attributes.
|
||||
|
||||
Returns:
|
||||
List[AbtractAttrDef]: Attribute definitions common for load
|
||||
List[AbstractAttrDef]: Attribute definitions common for load
|
||||
plugins.
|
||||
"""
|
||||
|
||||
|
|
@ -1513,7 +1513,7 @@ class PlaceholderCreateMixin(object):
|
|||
as defaults for attributes.
|
||||
|
||||
Returns:
|
||||
List[AbtractAttrDef]: Attribute definitions common for create
|
||||
List[AbstractAttrDef]: Attribute definitions common for create
|
||||
plugins.
|
||||
"""
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import copy
|
|||
from qtpy import QtWidgets, QtCore
|
||||
|
||||
from openpype.lib.attribute_definitions import (
|
||||
AbtractAttrDef,
|
||||
AbstractAttrDef,
|
||||
UnknownDef,
|
||||
HiddenDef,
|
||||
NumberDef,
|
||||
|
|
@ -33,9 +33,9 @@ def create_widget_for_attr_def(attr_def, parent=None):
|
|||
|
||||
|
||||
def _create_widget_for_attr_def(attr_def, parent=None):
|
||||
if not isinstance(attr_def, AbtractAttrDef):
|
||||
if not isinstance(attr_def, AbstractAttrDef):
|
||||
raise TypeError("Unexpected type \"{}\" expected \"{}\"".format(
|
||||
str(type(attr_def)), AbtractAttrDef
|
||||
str(type(attr_def)), AbstractAttrDef
|
||||
))
|
||||
|
||||
if isinstance(attr_def, NumberDef):
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import inspect
|
|||
from qtpy import QtGui
|
||||
import qtawesome
|
||||
|
||||
from openpype.lib.attribute_definitions import AbtractAttrDef
|
||||
from openpype.lib.attribute_definitions import AbstractAttrDef
|
||||
from openpype.tools.attribute_defs import AttributeDefinitionsDialog
|
||||
from openpype.tools.utils.widgets import (
|
||||
OptionalAction,
|
||||
|
|
@ -43,7 +43,7 @@ def get_options(action, loader, parent, repre_contexts):
|
|||
if not getattr(action, "optioned", False) or not loader_options:
|
||||
return options
|
||||
|
||||
if isinstance(loader_options[0], AbtractAttrDef):
|
||||
if isinstance(loader_options[0], AbstractAttrDef):
|
||||
qargparse_options = False
|
||||
dialog = AttributeDefinitionsDialog(loader_options, parent)
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from openpype.style import (
|
|||
get_objected_colors,
|
||||
get_style_image_path
|
||||
)
|
||||
from openpype.lib.attribute_definitions import AbtractAttrDef
|
||||
from openpype.lib.attribute_definitions import AbstractAttrDef
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
|
@ -406,7 +406,7 @@ class OptionalAction(QtWidgets.QWidgetAction):
|
|||
|
||||
def set_option_tip(self, options):
|
||||
sep = "\n\n"
|
||||
if not options or not isinstance(options[0], AbtractAttrDef):
|
||||
if not options or not isinstance(options[0], AbstractAttrDef):
|
||||
mak = (lambda opt: opt["name"] + " :\n " + opt["help"])
|
||||
self.option_tip = sep.join(mak(opt) for opt in options)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue