Ë
    šQjJ  ã                  óú   — d Z ddlmZ ddlmZ ddlmZmZmZmZ ddl	m
Z
 ddlmZ ddlmZ erdd	lmZ dd
lmZ dZ ed«      Z edd¬«      Z edd¬«      Z	 	 	 	 	 	 dd„Zdd„Z G d„ d«      Z G d„ de«      Zy)zObject utilities.é    )Úannotations)Úcopy)ÚTYPE_CHECKINGÚAnyÚCallableÚTypeVaré   )Úmaybe_channel)ÚNotBoundError)ÚChannelPromise)Ú
Connection)ÚChannel)ÚObjectÚMaybeChannelBoundÚ_TÚ_ObjectTyper   )ÚboundÚ_MaybeChannelBoundTyper   c                ó   —  | di |¤ŽS ©N© r   )ÚclsÚkwargss     úJ/var/www/html/truck-me/venv/lib/python3.12/site-packages/kombu/abstract.pyÚunpickle_dictr      s   € ñ ‰=�‰=Ðó    c                ó   — | S ©Nr   )Úvs    r   Ú_anyr        s   € Ø€Hr   c                  óB   — e Zd ZU dZdZded<   d
d„Zddd„Zdd„Zdd„Z	y	)r   zYCommon base class.

    Supports automatic kwargs->attributes handling, and cloning.
    r   ztuple[tuple[str, Any], ...]Úattrsc                óÜ   — | j                   D ]A  \  }}|j                  |«      }|�t        | | |xs t        |«      «       Œ5	 t	        | |«       ŒC y # t
        $ r t        | |d «       Y Œ]w xY wr   )r"   ÚgetÚsetattrr    ÚgetattrÚAttributeError)ÚselfÚargsr   ÚnameÚtype_Úvalues         r   Ú__init__zObject.__init__,   sp   € ØŸ:™:ò 	.‰KˆD�%Ø—J‘J˜tÓ$ˆEØÐ Ü˜˜d ] U¢]¬d°EÓ$:Õ;ð.Ü˜D $Õ'ñ	.øô &ò .Ü˜D $¨Ö-ð.ús   ÁAÁA+Á*A+c                ó€   ‡— ddˆfd„}| j                   D ��ci c]  \  }}| |t        | |«      |«      “Œ c}}S c c}}w )Nc                óh   •— ‰r"t        | t        «      r| j                  d¬«      S |r
| � || «      S | S )NT)Úrecurse)Ú
isinstancer   Úas_dict)ÚobjÚtyper0   s     €r   ÚfzObject.as_dict.<locals>.f8   s5   ø€ Ùœ: c¬6Ô2Ø—{‘{¨4�{Ó0Ð0Ù $¨¨‘4˜“9ÐA¸cÐAr   r   )r3   r   r4   zCallable[[Any], Any] | NoneÚreturnr   )r"   r&   )r(   r0   r5   Úattrr4   s    `   r   r2   zObject.as_dict7   sE   ø€ ö	Bð
 BFÇÁ÷
Ù3=°4¸ˆD‘!”G˜D $Ó'¨Ó.Ñ.ó
ð 	
ùó 
s   ˜:c                óF   — t         | j                  | j                  «       ffS r   )r   Ú	__class__r2   ©r(   s    r   Ú
__reduce__zObject.__reduce__@   s   € ô ˜tŸ~™~¨t¯|©|«~Ð>Ð>Ð>r   c                óB   —  | j                   di | j                  «       ¤ŽS r   )r9   r2   r:   s    r   Ú__copy__zObject.__copy__F   s   € Øˆt�~‰~Ñ/ §¡£Ñ/Ð/r   N)r)   r   r   r   r6   ÚNone)F)r0   Úboolr6   údict[str, Any])r(   r   r6   zktuple[Callable[[type[_ObjectType], dict[str, Any]], _ObjectType], tuple[type[_ObjectType], dict[str, Any]]])r(   r   r6   r   )
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r"   Ú__annotations__r-   r2   r;   r=   r   r   r   r   r   $   s(   … ñð
 *,€EÐ&Ó+ó	.ô
ó?ô0r   c                  óª   — e Zd ZU dZdZded<   dZdZ	 	 	 	 	 	 dd„Z	 	 	 	 	 	 dd„Z		 	 	 	 	 	 dd„Z
dd	„Zdd
„Zdd„Zddd„Zedd„«       Zedd„«       Zy)r   z7Mixin for classes that can be bound to an AMQP channel.NzChannel | NoneÚ_channelFc                ó$   — | j                  |«      S )z&`self(channel) -> self.bind(channel)`.)Úbind©r(   Úchannels     r   Ú__call__zMaybeChannelBound.__call__S   s   € ð �y‰y˜Ó!Ð!r   c                ó6   — t        | «      j                  |«      S )z7Create copy of the instance that is bound to a channel.)r   Ú
maybe_bindrJ   s     r   rI   zMaybeChannelBound.bindY   s   € ô �D‹z×$Ñ$ WÓ-Ð-r   c                óp   — | j                   s)|r't        |«      | _        | j                  «        d| _        | S )z.Bind instance to channel if not already bound.T)Úis_boundr
   rG   Ú
when_boundÚ	_is_boundrJ   s     r   rN   zMaybeChannelBound.maybe_bind_   s/   € ð �}Š}¡Ü)¨'Ó2ˆDŒMØ�O‰OÔØ!ˆDŒNØˆr   c                óL   — | j                   r|| _        | j                  «        yy)zyRevive channel after the connection has been re-established.

        Used by :meth:`~kombu.Connection.ensure`.

        N)rP   rG   rQ   rJ   s     r   ÚrevivezMaybeChannelBound.revivei   s!   € ð �=Š=Ø#ˆDŒMØ�O‰OÕð r   c                 ó   — y)z(Callback called when the class is bound.Nr   r:   s    r   rQ   zMaybeChannelBound.when_bounds   s   � r   c                óJ   — | j                  t        | «      j                  «      S r   )Ú_repr_entityr4   rA   r:   s    r   Ú__repr__zMaybeChannelBound.__repr__v   s   € Ø× Ñ ¤ d£×!4Ñ!4Ó5Ð5r   c                óÒ   — |xs t        | «      j                  }| j                  r=dj                  |xs t        | «      j                  | j                  j
                  «      S d|› d�S )Nz<{} bound to chan:{}>z	<unbound ú>)r4   rA   rP   ÚformatrK   Ú
channel_id)r(   Úitems     r   rW   zMaybeChannelBound._repr_entityy   s_   € ØÒ*”t˜D“z×*Ñ*ˆØ�=Š=Ø*×1Ñ1ØÒ+œ˜T›
×+Ñ+¨T¯\©\×-DÑ-DóFð Fà˜4˜& Ð"Ð"r   c                ó:   — | j                   xr | j                  duS )z!Flag set if the channel is bound.N)rR   rG   r:   s    r   rP   zMaybeChannelBound.is_bound€   s   € ð �~‰~Ò; $§-¡-°tÐ";Ð;r   c                ó¸   — | j                   }|€-t        dj                  t        | «      j                  «      «      ‚t        |t        «      r |«       x}| _         |S )z'Current channel if the object is bound.z.Can't call method on {} not bound to a channel)rG   r   r[   r4   rA   r1   r   rJ   s     r   rK   zMaybeChannelBound.channel…   sY   € ð —-‘-ˆØˆ?ÜØ@×GÑGÜ˜“J×'Ñ'ó)ó*ð *ô �gœ~Ô.Ù&-£iÐ/ˆG�d”mØˆr   )r(   r   rK   zChannel | Connectionr6   r   )rK   r   r6   r>   )r6   r>   )r6   Ústr)Ú )r]   r`   r6   r`   )r6   r?   )r6   r   )rA   rB   rC   rD   rG   rE   rR   Úcan_cache_declarationrL   rI   rN   rT   rQ   rX   rW   ÚpropertyrP   rK   r   r   r   r   r   J   s¯   … ÙAà#€HˆnÓ#Ø€Ið "Ðð"Ø$ð"Ø0Dð"à	ó"ð.Ø$ð.Ø0Dð.à	ó.ðØ$ðØ0Dðà	óóó7ó6ô#ð ò<ó ð<ð ò	ó ñ	r   N)r   ztype[_ObjectType]r   r@   r6   r   )r   r   r6   r   )rD   Ú
__future__r   r   Útypingr   r   r   r   Ú
connectionr
   Ú
exceptionsr   Úutils.functionalr   Úkombu.connectionr   Úkombu.transport.virtualr   Ú__all__r   r   r   r   r    r   r   r   r   r   ú<module>rl      sŽ   ðÙ å "å ß 8Ó 8å %Ý %Ý ,áÝ+Ý/ð *€áˆTƒ]€Ù�m¨8Ô4€Ù ØÐ$7ôÐ ð
Ø	ðØ$2ðàóó÷#0ñ #0ôLE˜õ Er   