o
    —¨Êhí  ã                   @  sl   d Z ddlmZ ddlmZmZmZ ddlmZ dd„ Z	dd„ Z
d	d
„ Zdd„ Zdd„ Zdd„ Zdd„ ZdS )zEvent-loop debugging tools.é    )Úannotations)ÚERRÚREADÚWRITE)Úreprcallc                 C  s4   d  | t@ rdnd| t@ rdnd| t@ rd¡S d¡S )z&Return description of event loop flag.z{}{}{}ÚRÚ ÚWú!)Úformatr   r   r   )Úflag© r   úJ/var/www/html/env/lib/python3.10/site-packages/kombu/asynchronous/debug.pyÚ	repr_flag	   s   
þþr   c                 C  s@   | d u rdS t | tƒr| S t | tƒr| \}}t|j|d�S | jS )Nz	<missing>)Úargs)Ú
isinstanceÚstrÚtupler   Ú__name__)ÚobjÚcbr   r   r   r   Ú_rcb   s   

r   c                 C  s   d  t| ƒt| ƒ ¡S )z1Return description of active readers and writers.ú, )ÚjoinÚrepr_readersÚrepr_writers©Úhr   r   r   Úrepr_active   s   r   c                   s   d  ‡ fdd„|D ƒ¡S )z.Return description of events returned by poll.r   c              	   3  s4   � | ]\}}d   ttˆ ||dƒƒ|t|ƒ¡V  qdS )z
{}({})->{}z(GONE)N)r   r   Úcallback_forr   )Ú.0ÚfdÚflr   r   r   Ú	<genexpr>"   s   € üþ
ÿzrepr_events.<locals>.<genexpr>)r   )r   Úeventsr   r   r   Úrepr_events    s   ûr%   c                 C  ó   dd„ | j  ¡ D ƒS )z&Return description of pending readers.c              
   S  s2   g | ]\}}d |› dt |ƒ› dtttB ƒ› �‘qS ©ú(ú)z->)r   r   r   r   ©r    r!   r   r   r   r   Ú
<listcomp>-   s    &ÿz repr_readers.<locals>.<listcomp>)ÚreadersÚitemsr   r   r   r   r   +   ó   ÿr   c                 C  r&   )z&Return description of pending writers.c              	   S  s.   g | ]\}}d |› dt |ƒ› dttƒ› �‘qS r'   )r   r   r   r*   r   r   r   r+   3   s    "ÿz repr_writers.<locals>.<listcomp>)Úwritersr-   r   r   r   r   r   1   r.   r   c                 G  sb   z |t @ r| j| W S |t@ r|| jv r| jW S | j| W S W dS  ty0   |r/|d  Y S ‚ w )z)Return the callback used for hub+fd+flag.r   N)r   r,   r   ÚconsolidateÚconsolidate_callbackr/   ÚKeyError)r   r!   r   Údefaultr   r   r   r   7   s   
ýýr   N)Ú__doc__Ú
__future__r   Úkombu.utils.eventior   r   r   Úkombu.utils.functionalr   r   r   r   r%   r   r   r   r   r   r   r   Ú<module>   s    