
    zi                    t    d Z ddlmZ ddlZddlmZ ej        rddlmZ ej	        e         Z
i ZddZdddZdS )a!  A registry of :class:`Schema <marshmallow.Schema>` classes. This allows for string
lookup of schemas, which may be used with
class:`fields.Nested <marshmallow.fields.Nested>`.

.. warning::

    This module is treated as private API.
    Users should not need to use this module directly.
    )annotationsN)RegistryError)Schema	classnamestrcls
SchemaTypereturnNonec                   |j         d                    | g          }| t          v rGt          fdt          |          D                       s!t          |                              |           n| t          vr|gt          | <   |t          vr/t                              |g                               |           n|gt          |<   dS )a  Add a class to the registry of serializer classes. When a class is
    registered, an entry for both its classname and its full, module-qualified
    path are added to the registry.

    Example: ::

        class MyClass:
            pass

        register('MyClass', MyClass)
        # Registry:
        # {
        #   'MyClass': [path.to.MyClass],
        #   'path.to.MyClass': [path.to.MyClass],
        # }

    .c              3  .   K   | ]}|j         k    V  d S )N)
__module__).0eachmodules     e/var/www/tmov.alphamb/tmov_inventario/venv/lib/python3.11/site-packages/marshmallow/class_registry.py	<genexpr>zregister.<locals>.<genexpr>5   s;       * *&*6!* * * * * *    N)r   join	_registryanyappend
setdefault)r   r   fullpathr   s      @r   registerr      s    & ^F xx+,,H Ic * * * *.7	.B* * * ' ' 	)##C((((	)	#	# #u	) y  Xr**11#6666  #e	(4r   Fallboollist[SchemaType] | SchemaTypec                8   	 t           |          }n5# t          $ r(}t          d                    |                     |d}~ww xY wt	          |          dk    r1|rt           |          S t          d                    |                     t           |          d         S )zRetrieve a class from the registry.

    :raises: marshmallow.exceptions.RegistryError if the class cannot be found
        or if there are multiple entries for the given class name.
    zEClass with name {!r} was not found. You may need to import the class.N   zWMultiple classes with name {!r} were found. Please use the full, module-qualified path.r   )r   KeyErrorr   formatlen)r   r   classeserrors       r   	get_classr'   E   s    I&   ##)6)#4#4
 
 	
 7||a 	(Y''%%+VI%6%6
 
 	
 #A&&s    
A#=A)r   r   r   r	   r
   r   )F)r   r   r   r   r
   r   )__doc__
__future__r   typingmarshmallow.exceptionsr   TYPE_CHECKINGmarshmallowr   Typer	   r   r   r'    r   r   <module>r0      s     # " " " " "  0 0 0 0 0 0	 %""""""V$J 	' ' ' 'T' ' ' ' ' ' 'r   