HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib/python3.10/site-packages/celery/bin/__pycache__/shell.cpython-310.pyc
o

-we��
@s2dZddlZddlZddlmZddlZddlmZmZm	Z	dd�Z
dd�Zd	d
�Zdd�Z
d
d�Zdd�Zdd�Zdd�Zdd�Zejeddid�ejdddeddd�ejdd dedd!d�ejd"dedd#d�ejd$d%dedd&d�ejd'dedd(d�ejd)dedd*d�eje		+	+	+d.d,d-����������ZdS)/z3The ``celery shell`` program, used to start a REPL.�N)�
import_module)�
CeleryCommand�CeleryOption�handle_preload_optionscCs\ddl}zddl}Wn	tyYnwddl}|�|�|�j�|�d�|j|d�dS)Nrztab:complete)�local)	�code�readline�ImportError�rlcompleter�
set_completer�	Completer�complete�parse_and_bind�interact)�localsrrr
�r�I/home/arjun/projects/env/lib/python3.10/site-packages/celery/bin/shell.py�_invoke_fallback_shells�
�
rcCsddl}|�|�dS�Nr)�bpython�embed)rrrrr�_invoke_bpython_shellsrc	Cs8tttttfD]}z||�WStyYqwdS)N)�_ipython�_ipython_pre_10�_ipython_terminal�_ipython_010�_no_ipythonr	)r�iprrr�_invoke_ipython_shells���rcCsddlm}|g|d�dS)Nr)�
start_ipython��argv�user_ns)�IPythonr)rrrrrr)srcCs:ddlm}|��}|jgd�|jj�|�|��dS)Nr)�TerminalIPythonApp)r!)�IPython.frontend.terminal.ipappr$�instance�
initialize�shellr"�update�start)rr$�apprrrr.s
rcCs ddlm}|j|d���dS)Nr)r)r")�IPython.terminalr�TerminalInteractiveShell�mainloop)rrrrrr6�rcCs ddlm}|g|d���dS)Nr)�IPShellr )�
IPython.Shellr0r.)rr0rrrr;r/rcCstd��)Nzno suitable ipython found)r	)�selfrrrr@srcCsbzddl}Wn$ty*zddl}Wnty"t|�YYdSwt|�YdSwt|�dSr)r#r	rrrr)rr#rrrr�_invoke_default_shellDs��r3�allow_extra_argsT)�cls�context_settingsz-Iz	--ipythonz
Shell OptionszForce IPython.)�is_flagr5�
help_group�helpz-Bz	--bpythonzForce bpython.z--pythonzForce default Python shell.z-Tz--without-taskszDon't add tasks to locals.z
--eventletz
Use eventlet.z--geventzUse gevent.FcKs4tj�dt���|rtd�|rtd�ddl}|jj}	|	j	�
�|	|	|j|j|j
|j|j|j|j|j|jd�}
|sH|
�dd�|	j��D��|rOt|
�nE|rlzt|
�Wn<tyk|j�|jj�d��Yn)w|r�zt|
�Wnty�}z|j�|jj�d	|���WYd}~nd}~wwt|
�dS)
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.
    rzcelery.concurrency.eventletzcelery.concurrency.geventN)r+�celery�Task�chord�group�chain�chunks�xmap�xstarmap�subtask�	signaturecSs i|]}|j�d�s|j|�qS)zcelery.)�name�
startswith�__name__)�.0�taskrrr�
<dictcomp>�s
��zshell.<locals>.<dictcomp>z: bpython is not installedz: )�sys�path�insert�os�getcwdrr:�objr+�loader�import_default_modulesr;r<r=r>r?r@rArBrCr)�tasks�valuesrrr	�echo�ERRORrr3)�ctx�ipythonr�python�
without_tasks�eventlet�gevent�kwargsr:r+r�errrr(RsP1
�
�
�&��r()FFFFFF)�__doc__rMrJ�	importlibr�click�celery.bin.baserrrrrrrrrrrr3�command�option�pass_contextr(rrrr�<module>s~
������� �