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/buyercall/buyercall/__pycache__/app.cpython-310.pyc
o

�we��@s�ddlmZmZmZddlmZddlmZddlm	Z	m
Z
mZmZm
Z
mZmZmZmZmZddlmZmZgd�Zddd	�Zedfd
d�Zddd
�ZdS)�)�Flask�has_request_context�request)�Celery)�User)
�api_keys�
blueprints�error_templates�exception_handler�
extensions�logging_handler�
middleware�template_processors�context_handlers�api_error_handlers)�authentication�locale)z#buyercall.blueprints.activity.taskszbuyercall.blueprints.user.tasksz buyercall.blueprints.issue.tasksz"buyercall.blueprints.billing.tasksz buyercall.blueprints.admin.tasksz+buyercall.blueprints.contacts.contact_tasksz"buyercall.blueprints.widgets.tasksz%buyercall.blueprints.widgets.bw_tasksz*buyercall.blueprints.form_leads.form_tasksz"buyercall.blueprints.reports.tasksz&buyercall.blueprints.partnership.tasksz'buyercall.blueprints.phonenumbers.tasksz*buyercall.blueprints.phonenumbers.bw_tasksz6buyercall.blueprints.phonenumbers.bw_operational_tasksz!buyercall.blueprints.mobile.tasksz%buyercall.blueprints.sms.bw_sms_tasksz%buyercall.blueprints.sms.tw_sms_taskszbuyercall.blueprints.sms.tasksNcsj�pt��t�j�jd�jdd�}|jtdd�|j��j�|j�G���fdd�d����|_|S)z�
    Create a new celery object and tie together the celery config to the app's
    config. Wrap all tasks in the context of the application.

    :param app: Flask app
    :return: Celery app
    �CELERY_BROKER_URL�CELERY_RESULT_BACKEND)�broker�result_backendT)�forcecs>eZdZdZdZdd�Zd
��fdd�	Z��fdd	�Z�ZS)z&create_celery_app.<locals>.ContextTaskT�_flask_request_contextcSsZt�sdStjtjtjttj�d�}dtjvr&tjtj�d�dd�|d<|||j	<dS)zIncludes all the information about current HTTP request context
            as an additional argument to the task.
            N)�path�base_url�method�headers�?��query_string)
rrr�url_rootr�dictr�url�find�CONTEXT_ARG_NAME)�self�kwargs�context�r(�//home/arjun/projects/buyercall/buyercall/app.py�_include_request_context>s�
z?create_celery_app.<locals>.ContextTask._include_request_contextNcs4|pd}|pi}|�|�t�|�j||fi|��S�Nr()r*�super�apply_async)r%�argsr&�rest)�ContextTask�	__class__r(r)r-Ps
z2create_celery_app.<locals>.ContextTask.apply_asynccs�|�|jd�}|dust�r�j|g|�Ri|��S�jdi|����j|g|�Ri|��Wd�S1s9wYdSr+)�popr$r�__call__�test_request_context)r%r.r&r')�TaskBase�appr(r)r3Ws$�z/create_celery_app.<locals>.ContextTask.__call__)NN)	�__name__�
__module__�__qualname__�abstractr$r*r-r3�
__classcell__r(�r0r5r6)r1r)r09sr0)	�
create_appr�import_name�config�autodiscover_tasks�CELERY_TASK_LIST�conf�update�Task)r6�celeryr(r<r)�create_celery_app)s
�&rFcCs�t|dd�}t||�t|�t|�t|�t|�t|�t|�t|�t	|�t
|�t|�t|t
�t|d�rGt|jd�rGt|�|S)a
    Create an application using the Flask app factory pattern:
    http://flask.pocoo.org/docs/0.10/patterns/appfactories

    :param application_name: Name of the application
    :param settings_override: Override settings
    :type settings_override: dict
    :return: Flask app
    T)�instance_relative_config�babel_instance�locale_selector_func)r�configure_settingsrr
rrrrrr
r	rrr�hasattrrHr)�application_name�settings_overrider6r(r(r)r=cs 


r=cCs:|j�d�|jjddd�d|j_|r|j�|�|jS)z�
    Modify the settings of the application (mutates the app passed in).

    :param app: Flask application instance
    :param settings_override: Override settings
    :type settings_override: dict
    :return: Add configuration settings
    zconfig.settingszsettings.pyT)�silent�none)r?�from_object�from_pyfile�SWAGGER_UI_DOC_EXPANSIONrC)r6rMr(r(r)rJ�s	rJ)N)�flaskrrrrEr� buyercall.blueprints.user.modelsr�buyercall.registerrrr	r
rrr
rrr�buyercall.initializerrrArFr7r=rJr(r(r(r)�<module>s0
:%