o
    Df"                     @   sX   d Z ddlZddlmZmZ ejddejedd Zejedejd	d
 Z	dS )zEThe ``celery list bindings`` command, used to inspect queue bindings.    N)CeleryCommandhandle_preload_optionslist)namec                 C   s   dS )z^Get info from broker.

    Note:

        For RabbitMQ the management plugin is required.
    N ctxr   r   H/home/ubuntu/webapp/venv/lib/python3.10/site-packages/celery/bin/list.pylist_   s    r
   )clsc              	      s    j j}| H}|j|  z|j }W n ty$   t	
dw  fdd}|ddd |ddd |D ]}||d |d	 |d
  q9W d   dS 1 sSw   Y  dS )zInspect queue bindings.z$Your transport cannot list bindings.c                    s$    j | dd|dd|  d S )Nz<28 )objecho)qerr   r   r	   fmt!   s   $zbindings.<locals>.fmtQueueExchangezRouting Keyz----------------destinationsourcerouting_keyN)r   app
connectionamqpTaskConsumerdeclaremanagerget_bindingsNotImplementedErrorclick
UsageError)r   r   connbindingsr   br   r   r	   r#      s   

"r#   )
__doc__r    celery.bin.baser   r   grouppass_contextr
   commandr#   r   r   r   r	   <module>   s    

	