o
    Df                     @   sr   d Z 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Zd	Zeejd
dZG dd de
ZdS )z@The default loader used when no custom app has been initialized.    N)NotConfiguredDictAttribute)	strtobool   )
BaseLoader)LoaderDEFAULT_CONFIG_MODULEceleryconfig	C_WNOCONFFc                   @   s"   e Zd ZdZdd ZdddZdS )	r   z#The loader used by the default app.c                 C   s   t |S )Nr   )selfsettingsdict r   O/home/ubuntu/webapp/venv/lib/python3.10/site-packages/celery/loaders/default.pysetup_settings   s   zLoader.setup_settingsTc              	   C   sv   t jdt}z| |}W n$ ty2   |s tr+t jds+tt	dj
|d | i  Y S w d| _| |S )z0Read configuration from :file:`celeryconfig.py`.CELERY_CONFIG_MODULEFORKED_BY_MULTIPROCESSINGzPNo {module} module found! Please make sure it exists and is available to Python.)moduleT)osenvirongetr	   _import_config_moduleImportErrorr   warningswarnr   formatr   
configured)r   fail_silently
confignameusercfgr   r   r   read_configuration   s$   

zLoader.read_configurationN)T)__name__
__module____qualname____doc__r   r    r   r   r   r   r      s    r   )r$   r   r   celery.exceptionsr   celery.utils.collectionsr   celery.utils.serializationr   baser   __all__r	   r   r   r   r   r   r   r   r   <module>   s    