Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/celery/backends/__pycache__/arangodb.cpython-39.pyc
Ðазад
a t�h1 � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl m Z zddlmZ dd lmZ W n eyv d Z ZY n0 dZG dd � d e �Zd S )zArangoDb result store backend.� )� timedelta)�cached_property)� _parse_url)�ImproperlyConfigured� )�KeyValueStoreBackend)� connection)� AQLQueryErrorN)�ArangoDbBackendc s� e Zd ZdZdZdZdZdZdZdZ dZ dZeZ d� fdd � Zed d� �Zedd � �Zedd� �Zdd� Zdd� Zdd� Zdd� Zdd� Z� ZS )r a� ArangoDb backend. Sample url "arangodb://username:password@host:port/database/collection" *arangodb_backend_settings* is where the settings are present (in the app.conf) Settings should contain the host, port, username, password, database name, collection name else the default will be chosen. Default database name and collection name is celery. Raises ------ celery.exceptions.ImproperlyConfigured: if module :pypi:`pyArango` is not available. z 127.0.0.1Z8529ZceleryN�httpFc sv t � j|i |�� tdu r"td��|| _|du rJd } } } } }} n6t|�\} }}}} }}|du rrd }}n|�d�\}}| jj� dd�} | dur�t | t�s�td��ni } |p�| � d| j�| _t |p�| � d| j��| _| � d| j�| _| � d | j�| _|�p| � d | j�| _|�p$| � d| j�| _|�p:| � d| j�| _| �pP| � d | j�| _dj| j| j| jd�| _d| _dS )z8Parse the url or load the settings from settings object.NzEYou need to install the pyArango library to use the ArangoDb backend.�/Zarangodb_backend_settingsz5ArangoDb backend settings should be grouped in a dict�host�port� http_protocol�verify�database� collection�username�passwordz{http_protocol}://{host}:{port})r r r )�super�__init__�py_arango_connectionr �urlr �split�appZconf�get� isinstance�dictr �intr r r r r r r �format�arangodb_url�_connection)�selfr �args�kwargsr r r r r r Z_schemaZdatabase_collectionZ_query�config�� __class__� ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/celery/backends/arangodb.pyr 6 sF �� ���zArangoDbBackend.__init__c C s, | j du r&tj| j| j| j| jd�| _ | j S )zConnect to the arangodb server.N)Z arangoURLr r r )r! r � Connectionr r r r �r"