diff --git a/openpype/pipeline/lib/attribute_definitions.py b/openpype/pipeline/lib/attribute_definitions.py new file mode 100644 index 0000000000..b0e9acade2 --- /dev/null +++ b/openpype/pipeline/lib/attribute_definitions.py @@ -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