Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/celery/backends/__pycache__/couchdb.cpython-39.pyc
Ðазад
a t�hw � @ st d Z ddlmZ ddlmZ ddlmZ ddlmZ zddl Z W n e yV dZ Y n0 dZd ZG d d� de�Z dS )zCouchDB result store backend.� )�bytes_to_str)� _parse_url)�ImproperlyConfigured� )�KeyValueStoreBackendN)�CouchBackendzKYou need to install the pycouchdb library to use the CouchDB result backendc sn e Zd ZdZdZdZdZdZdZdZ d� fdd� Z d d � Zedd� �Z d d� Zdd� Zdd� Zdd� Z� ZS )r z�CouchDB backend. Raises: celery.exceptions.ImproperlyConfigured: if module :pypi:`pycouchdb` is not available. �default�http� localhosti` Nc s� t � j|i |�� || _td u r(tt��d } } } } }} |rlt|�\} }}}}} } | rh| �d�nd } |pt| j| _|p�| j | _ t |p�| j�| _| p�| j| _|p�| j | _ |p�| j| _d | _d S )N�/)�super�__init__�url� pycouchdbr �ERR_LIB_MISSINGr �strip�scheme�host�int�port� container�username�password�_connection)�selfr �args�kwargsZuschemeZuhostZuport�unameZupassZ ucontainer�_�� __class__� ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/celery/backends/couchdb.pyr $ s zCouchBackend.__init__c C s� | j rF| jrF| j� d| j � d| j� d| j� d| j� � }tj|dd�}n$| j� d| j� d| j� �}t�|�}z|�| j�W S tj j y� |�| j� Y S 0 dS )zConnect to the CouchDB server.z://�:�@�basic)Z authmethodN)r r r r r r �ServerZdatabaser � exceptions�NotFound�create)r Zconn_string�serverr! r! r"