mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 08:54:53 +01:00
initial commit of AbtractAttrDef the abstract attribute definition
This commit is contained in:
parent
57b18fcd23
commit
c6c7c92d0c
1 changed files with 24 additions and 0 deletions
24
openpype/pipeline/lib/attribute_definitions.py
Normal file
24
openpype/pipeline/lib/attribute_definitions.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
from abc import ABCMeta, abstractmethod
|
||||
import six
|
||||
|
||||
|
||||
@six.add_metaclass(ABCMeta)
|
||||
class AbtractAttrDef:
|
||||
"""Abstraction of attribute definiton.
|
||||
|
||||
Each attribute definition must have implemented validation and
|
||||
conversion method.
|
||||
|
||||
Attribute definition should have ability to return "default" value. That
|
||||
can be based on passed data into `__init__` so is not abstracted to
|
||||
attribute.
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
def convert_value(self, value):
|
||||
"""Convert value to a valid one.
|
||||
|
||||
Convert passed value to a valid type. Use default if value can't be
|
||||
converted.
|
||||
"""
|
||||
pass
|
||||
Loading…
Add table
Add a link
Reference in a new issue