
    h                        d Z ddlZddlZddlmZ ddlZddlmZmZm	Z	 d Z
d Zd Zd Zd	 Zd
 Zd Zd Zd Z ej&                  eddi       ej(                  dddedd       ej(                  dddedd       ej(                  ddedd       ej(                  dddedd       ej(                  ddedd       ej(                  d dedd!      ej*                  e		 	 	 d#d"                                                               Zy)$z3The ``celery shell`` program, used to start a REPL.    N)import_module)CeleryCommandCeleryOptionhandle_preload_optionsc                     dd l }	 dd l}dd l}|j                  |j	                  |       j
                         |j                  d       |j                  |        y # t        $ r Y w xY w)Nr   ztab:complete)local)	codereadlinerlcompleterset_completer	Completercompleteparse_and_bindImportErrorinteract)localsr	   r
   r   s       L/var/www/Befach/backend/env/lib/python3.12/site-packages/celery/bin/shell.py_invoke_fallback_shellr      sd    0 	!!&)22	4/MMM  s   A 	A('A(c                 .    dd l }|j                  |        y Nr   )bpythonembed)r   r   s     r   _invoke_bpython_shellr      s    MM&    c                 v    t         t        t        t        t        fD ]  }	  ||       c S  y # t
        $ r Y w xY w)N)_ipython_ipython_pre_10_ipython_terminal_ipython_010_no_ipythonr   )r   ips     r   _invoke_ipython_shellr"      s>     ,	f:	
  		s   ,	88c                 $    ddl m}  |g |        y )Nr   )start_ipythonargvuser_ns)IPythonr$   )r   r$   s     r   r   r   )   s    %r6*r   c                     ddl m} |j                         }|j                  g        |j                  j
                  j                  |        |j                          y )Nr   )TerminalIPythonApp)r&   )IPython.frontend.terminal.ipappr*   instance
initializeshellr'   updatestart)r   r*   apps      r   r   r   .   sB    B

%
%
'CNNNIIV$IIKr   c                 P    ddl m} |j                  |       j                          y )Nr   )r   )r'   )IPython.terminalr   TerminalInteractiveShellmainloop)r   r   s     r   r   r   6   s    &	""6"2;;=r   c                 @    ddl m}  |g |       j                          y )Nr   )IPShellr%   )IPython.Shellr7   r5   )r   r7   s     r   r   r   ;   s    %V$--/r   c                     t        d      )Nzno suitable ipython found)r   )selfs    r   r    r    @   s    
1
22r   c                     	 dd l }t        |        y # t        $ r. 	 dd l}t	        |        Y y # t        $ r t        |        Y Y y w xY ww xY wr   )r(   r"   r   r   r   r   )r   r(   r   s      r   _invoke_default_shellr<   D   sP    
& 	f%  *	* "&)  	+"6*	+*s)    	A	-A	AA	AA	allow_extra_argsT)clscontext_settingsz-Iz	--ipythonzShell OptionszForce IPython.)is_flagr>   
help_grouphelpz-Bz	--bpythonzForce bpython.z--pythonzForce default Python shell.z-Tz--without-taskszDon't add tasks to locals.z
--eventletzUse eventlet.z--geventzUse gevent.c                    t         j                  j                  dt        j                                |rt        d       |rt        d       ddl}| j                  j                  }	|	j                  j                          |	|	|j                  |j                  |j                  |j                  |j                  |j                   |j"                  |j$                  |j&                  d}
|s]|
j)                  |	j*                  j-                         D ci c]*  }|j.                  j1                  d      s|j2                  |, c}       |rt5        |
       n|r	 t7        |
       n|r	 t?        |
       tA        |
       yc c}w # t8        $ r5 | j                  j;                  | j                  j<                   d       Y Nw xY w# t8        $ r>}| j                  j;                  | j                  j<                   d|        Y d}~d}~ww xY w)	a.  Start shell session with convenient access to celery symbols.

    The following symbols will be added to the main globals:
    - ``celery``:  the current application.
    - ``chord``, ``group``, ``chain``, ``chunks``,
      ``xmap``, ``xstarmap`` ``subtask``, ``Task``
    - all registered tasks.
    r   zcelery.concurrency.eventletzcelery.concurrency.geventN)r1   celeryTaskchordgroupchainchunksxmapxstarmapsubtask	signaturezcelery.z: bpython is not installedz: )!syspathinsertosgetcwdr   rD   objr1   loaderimport_default_modulesrE   rF   rG   rH   rI   rJ   rK   rL   rM   r/   tasksvaluesname
startswith__name__r   r   r   echoERRORr"   r<   )ctxipythonr   pythonwithout_taskseventletgeventkwargsrD   r1   r   taskes                r   r.   r.   R   s   b HHOOAryy{#3412
''++CJJ%%' --OO>>%%F ,/II,<,<,>
$(99''	2 MM4
 	
 v&		G!&) 
	2!&) &!#
  	GGGLLCGGMM?*DEF	G
  	2GGLLCGGMM?"QC011	2s0   /E?F (G ;GG	H4HH)FFFFFF)__doc__rQ   rN   	importlibr   clickcelery.bin.baser   r   r   r   r   r"   r   r   r   r   r    r<   commandoptionpass_contextr.    r   r   <module>rn      so   9 	 
 #  O O 
+
>
0
3& =4  d(#% d(#% j(0	2
 d(/1 l("	$
 j( 	"
 &+6;5"  "$12%%L5"r   