3 sr>cCs|j||ƒdS)zÞ Add a representer for the given type. Multi-representer is a function accepting a Dumper instance and an instance of the given data type or subtype and producing the corresponding representation node. N)Úadd_multi_representer)r?Zmulti_representerrrrr r@ sr@cs eZdZdZ‡fdd„Z‡ZS)ÚYAMLObjectMetaclassz' The metaclass for YAMLObject. csNtt|ƒj|||ƒd|krJ|ddk rJ|jj|j|jƒ|jj||j ƒdS)NÚyaml_tag) ÚsuperrAÚ__init__Ú yaml_loaderr;rBÚ from_yamlÚ yaml_dumperr>Úto_yaml)ÚclsÚnameÚbasesr,)Ú __class__rr rDszYAMLObjectMetaclass.__init__)Ú__name__Ú __module__Ú __qualname__Ú__doc__rDÚ __classcell__rr)rLr rAsrAc@s<eZdZdZfZeZeZdZ dZ e dd„ƒZ e dd„ƒZ dS)Ú YAMLObjectza An object that can dump itself to a YAML stream and load itself from a YAML stream. NcCs |j||ƒS)zC Convert a representation node to a Python object. )Zconstruct_yaml_object)rIrr*rrr rF*szYAMLObject.from_yamlcCs|j|j|||jdS)zC Convert a Python object to a representation node. )Z flow_style)Zrepresent_yaml_objectrBÚyaml_flow_style)rIrr0rrr rH1s zYAMLObject.to_yaml)rMrNrOrPÚ __slots__rrErrGrBrSÚ classmethodrFrHrrrr rRs rR)Ú metaclass)N)N)%ÚerrorÚtokensrr)rrÚ __version__ZcyamlZ__with_libyaml__Ú ImportErrorrrr r r r rrrrrrr+r'r1r2r4r5r6r9r;r=r>r@ÚtyperArRrrrr Ús^