o
    wvXjV  ã                   @   s€   d Z ddlmZmZ ddlmZ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.é    )Úabsolute_importÚunicode_literals)ÚitemsÚstring_t)ÚREADÚWRITEÚERR)Ú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	{0}{1}{2}ÚRÚ ÚWú!)Úformatr   r   r   )Úflag© r   úU/var/www/html/myproject/venv/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)Ú
isinstancer   Ú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{0}({1})->{2}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„ t | jƒD ƒS )z&Return description of pending readers.c              	   S   s*   g | ]\}}d   |t|ƒtttB ƒ¡‘qS ©z({0}){1}->{2})r   r   r   r   r   ©r"   r#   r   r   r   r   Ú
<listcomp>-   s    ÿz repr_readers.<locals>.<listcomp>)r   Úreadersr   r   r   r   r   +   ó   ÿr   c                 C   r(   )z&Return description of pending writers.c                 S   s&   g | ]\}}d   |t|ƒttƒ¡‘qS r)   )r   r   r   r   r*   r   r   r   r+   3   s    ÿz repr_writers.<locals>.<listcomp>)r   Úwritersr   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   r   Ú
kombu.fiver   r   Úkombu.utils.eventior   r   r   Úkombu.utils.functionalr	   r   r   r    r'   r   r   r!   r   r   r   r   Ú<module>   s    