U
    bh                     @   s  d Z ddlZddlZddlZddlZzddlmZ W n  ek
rT   ddlmZ Y nX ddl	Z	ddl
Z	ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dd	lmZmZmZ dd
lmZ ddlmZ ddlmZmZm Z  ddl!m"Z" ddl#m$Z$ ddl%m&Z& ddl'm(Z( ddl)m*Z* ddl+m,Z, ddl-m.Z. ddl/m0Z0 ddl1m2Z2 ddl3m4Z4 ddl5m6Z6 e	j7dddZ8e	j7dddZ9e	7dZ:ej;dkreddZ<n8ze =dg Z<W n$ e>k
r   e j?ddZ<Y nX ee<e	j@ed d!e	jAd"d#d$ee	jBd%d&e	jAd'd(d)ed%d*e	jAd+d,ed%d*e	jAd-d.ed%d*e	jAd/d0ed%d*e	jAd1eejCd2d3 d d%d4e	jAd5d6d7d ed%d8e	jAd9d:d ed%d;e	jAd<ed d%d=e	jAd>d?ed d%d@dAe	jDdBdC ZejEedDe	jDdEdF ZFeGe. eGe eGe eGe& eGe0 eGe* eGe  eGe6 eGe" eGe eGe eGe$ eGe4 eGe( eGe eGe2 eGe, e	jHjIjJZKdGZLdMdHdIZMeMe	jHjI_JeNdJdKdLZOdS )NzCelery Command Line Interface.    N)entry_points)DYMGroup)with_plugins)VERSION_BANNER)find_app)amqp)CeleryCommandCeleryOption
CLIContext)beat)call)controlinspectstatus)events)graph)list_)logtool)migrate)multi)purge)result)shell)upgrade)workerzA
Unable to load celery application.
The module {0} was not found.redZfgzi
Unable to load celery application.
While trying to load the module {0} the following error occurred:
{1}z'
Unable to load celery application.
{0})   
   zcelery.commands)groupT)clsZinvoke_without_command-A--appZAPPzGlobal Options)envvarr    type
help_groupz-bz--brokerZ
BROKER_URL)r#   r    r%   z--result-backendZRESULT_BACKENDz--loaderZLOADERz--configZCONFIG_MODULEz	--workdirc                 C   s   |rt |S d S )N)oschdir)___wd r+   5/tmp/pip-unpacked-wheel-kcem4wq5/celery/bin/celery.py<lambda>[       r-   )r    r$   callbackZis_eagerr%   z-Cz
--no-colorZNO_COLOR)r#   is_flagr    r%   z-qz--quiet)r0   r    r%   z	--version)r    r0   r%   z--skip-checksZSKIP_CHECKSzSkip Django core checks on startup. Setting the SKIP_CHECKS environment variable to any non-empty string will have the same effect.)r#   r    r0   r%   helpc              
   C   s  |	rt t |   n | jdkr8t |   |   |rF|tjd< |rT|tjd< |rb|tjd< |rp|tjd< |
r~dtjd< t|t	r^zt
|}W n tk
r } z:|j|krt }| t|| | t|j W 5 d}~X Y np tk
r. } z"|jd  }| t| W 5 d}~X Y n0 tk
r\   t }| t|| Y nX t||||d	| _tj| jjjd
g  t j| jjjdg  t!j| jjjdg  t"j#$ D ] }|j| jjjdg  qdS )zCelery command entrypoint.NZCELERY_LOADERZCELERY_BROKER_URLZCELERY_RESULT_BACKENDZCELERY_CONFIG_MODULEtrueZCELERY_SKIP_CHECKSr   )appno_colorworkdirquietr   r   r   Zpreload)%clickechor   exitZinvoked_subcommandZget_helpr&   environ
isinstancestrr   ModuleNotFoundErrorname	traceback
format_excZfail!UNABLE_TO_LOAD_APP_ERROR_OCCURREDformat#UNABLE_TO_LOAD_APP_MODULE_NOT_FOUNDAttributeErrorargs
capitalizeUNABLE_TO_LOAD_APP_APP_MISSING	Exceptionr
   objr   paramsextendr3   user_optionsgetr   r   celerycommandsvalues)ctxr3   ZbrokerZresult_backendloaderconfigr5   r4   r6   versionZskip_checkseexcZattribute_namecommandr+   r+   r,   rN   ;   sT    =









" 

rN   )r    c                 K   s&   | j j}|j  | j |  dS )z3Shows information useful to include in bug-reports.N)rI   r3   rR   Zimport_default_modulesr8   Z	bugreport)rQ   kwargsr3   r+   r+   r,   report   s    
rY   a  You are using `{option_name}` as an option of the {info_name} sub-command:
celery {info_name} {option_name} celeryapp <...>

The support for this usage was removed in Celery 5.0. Instead you should use `{option_name}` as a global option:
celery {option_name} celeryapp {info_name} <...>c                 C   s<   | j dkr,| jjjtj| j | jjddd t| |d d S )N)r!   r"   )option_name	info_namer   r   )file)rZ   rQ   rI   errorWRONG_APP_OPTION_USAGE_MESSAGErB   r[   previous_show_implementation)selfr\   r+   r+   r,   _show   s    
ra   )returnc                   C   s
   t ddS )zStart celery umbrella command.

    This function is the main entrypoint for the CLI.

    :return: The exit code of the CLI.
    ZCELERY)Zauto_envvar_prefix)rN   r+   r+   r+   r,   main   s    rc   )N)P__doc__r&   pathlibsysr?   importlib.metadatar   ImportErrorZimportlib_metadatar7   Zclick.exceptionsZclick_didyoumeanr   Zclick_pluginsr   rN   r   Zcelery.app.utilsr   Zcelery.bin.amqpr   Zcelery.bin.baser   r	   r
   Zcelery.bin.beatr   Zcelery.bin.callr   Zcelery.bin.controlr   r   r   Zcelery.bin.eventsr   Zcelery.bin.graphr   Zcelery.bin.listr   Zcelery.bin.logtoolr   Zcelery.bin.migrater   Zcelery.bin.multir   Zcelery.bin.purger   Zcelery.bin.resultr   Zcelery.bin.shellr   Zcelery.bin.upgrader   Zcelery.bin.workerr   stylerC   rA   rG   version_infoZ_PLUGINSrM   rD   selectr   optionZUNPROCESSEDPathZpass_contextrW   rY   Zadd_command
exceptionsZNoSuchOptionshowr_   r^   ra   intrc   r+   r+   r+   r,   <module>   s  

"5




















