
     h
                     <   d Z ddlZddlmZmZmZmZ ddlmZ  ej	        e           ej
        ddedd	d
           ej
        ddeed	d           ej
        ddeed	d          ej        ed                                                                         ZdS )zBThe ``celery purge`` program, used to delete messages from queues.    N)COMMA_SEPARATED_LISTCeleryCommandCeleryOptionhandle_preload_options)text)clsz-fz--forceTzPurging OptionszDon't prompt for verification.)r   is_flag
help_grouphelpz-Qz--queuesz-Comma separated list of queue names to purge.)r   typer
   r   z-Xz--exclude-queuesz2Comma separated list of queues names not to purge.c                    | j         j        }t          |p|j        j                                                  }t          |pg           }||z
  }t          |          }|r t          j        |d          }|s[d	                    t          |                    }t          j        | j                             dd           d| d| dd	
           d |                                5 t          fd|D                       }	ddd           n# 1 swxY w Y   |	r>t          j        |	d          }
| j                             d|	 d|
 d| d| d	           dS | j                             d| d| d           dS dS )zvErase all messages from all known task queues.

    Warning:

        There's no undo operation for this command.
    queuez, WARNINGred)fgz!:This will remove all tasks from z: z.
         There is no undo for this operation!

(to skip this prompt use the -f option)
Are you sure you want to delete all tasks?T)abortc                 ^    	 | j                             |          pdS # | j        $ r Y dS w xY w)Nr   )default_channelqueue_purgechannel_errors)connr   s     L/var/www/html/Sam_Eipo/venv/lib/python3.11/site-packages/celery/bin/purge.py_purgezpurge.<locals>._purge7   sH    +77>>C!C&   qqs    
,,c              3   0   K   | ]} |          V  d S )N ).0r   r   r   s     r   	<genexpr>zpurge.<locals>.<genexpr>>   s/      BB566$..BBBBBB    NmessagezPurged  z from z known task .zNo messages purged from )objappsetamqpqueueskeyslenr   	pluralizejoinsortedclickconfirmstyleconnection_for_writesumecho)ctxforcer&   exclude_queuesr#   namesqnumqueues_headlinequeue_namesmessagesmessages_headliner   r   s              @@r   purger;   	   sd   8 '+C138?//1122F-2..N^#Eu::D O.w77 	&))F5MM22KMSW]]9]?? G G,G G0;G G G !%& & & &	 	 	 %%'' 	C4BBBBBEBBBBBH	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C  	O $x C CGLL A8 A A.? A A A A.=A A A B B B B B GLLMDMM?MMMNNNNN5O Os   -DDD)__doc__r,   celery.bin.baser   r   r   r   celery.utilsr   commandoptionpass_contextr;   r   r   r   <module>rB      sd   H H C C C C C C C C C C C C       =!!!d*35 5 5 d'*BD D D d '*GI I I 'O 'O  I ID D5 5 "!*'O 'O 'Or   