관리-도구
편집 파일: extensions.cpython-37.pyc
B �v6dx � @ s� d dl mZ d dl mZ d dl mZ d dlZd dlZd dlmZ d dl Z d dl mZ d dlm Z d dlmZ d dlmZ d dlZe�d ej�ZG d d� de�ZG dd � d e�ZG dd� de�ZdS )� )�print_function)�division)�absolute_importN)�client)�configparser)�SafeConfigParser)� ExpatErrorz"^(?P<name>.+) \((?P<version>.+)\)$c s e Zd ZdZ� fdd�Z� ZS )�PyPIRpcApiErrorze Generic error class that means that we cannot properly get information from xml rpc api c s t t| ��d| � d S )Nz�We are having issues with PyPI RPC api. You can check https://status.python.org/ to see of there are any problems with PyPI or contact CloudLinux support if you see this message for a long time.Original message was: '%s')�superr �__init__)�self�message)� __class__� �W/opt/alt/python37/lib/python3.7/site-packages/clselect/clselectpythonuser/extensions.pyr ! s zPyPIRpcApiError.__init__)�__name__� __module__�__qualname__�__doc__r � __classcell__r r )r r r s r c s e Zd ZdZ� fdd�Z� ZS )�PyPIMaintenanceExceptionz� Raised when PyPY returns 503 error, which means that service is unavailable temporary and we should try again later. c s t t| ��d� d S )Nz�Looks like PyPI is down for maintenance and we are not able to use it. You can check https://status.python.org/ to see of there are any problems with PyPI or contact CloudLinux support if you see this message for a long time.)r r r )r )r r r r / s z!PyPIMaintenanceException.__init__)r r r r r r r r )r r r * s r c @ s` e Zd ZdZdd� Zdd� Zdd� Zdd � Zed d� �Z edd � �Z edd� �Zedd� �ZdS )� ExtensionInfozhttps://pypi.python.org/pypic C s t �| j�| _d S )N)� xmlrpclibZServerProxy�url�_rpc)r r r r r = s zExtensionInfo.__init__c O s� y| j �|�||�S tjtfk rF } ztt|���W d d }~X Y n� tjk r� } z"|j t jkrjt� �tt|���W d d }~X Y nZ tj k r� } zt|j��W d d }~X Y n. tjk r� } zt|j��W d d }~X Y nX d S )N)r �__getattr__�socket�gaierrorr r �strr � ProtocolError�errcode�httplib�SERVICE_UNAVAILABLEr ZFaultZfaultString�ssl�SSLError�strerror)r �method�args�kwargs�errr r r Z __get_rpc@ s zExtensionInfo.__get_rpcc C s | � d�}t�|�S )N� list_packages)�_ExtensionInfo__get_rpcr �extensions_docs)r � extensionsr r r �list_extensionsN s zExtensionInfo.list_extensionsc s t � fdd�|D ��S )Nc 3 s$ | ]}|d � � d|d�ifV qdS )�versionsZpackage_releasesTN)r+ )�.0� extension)r r r � <genexpr>U s z8ExtensionInfo.list_extensions_version.<locals>.<genexpr>)�dict)r r- r )r r �list_extensions_versionR s z%ExtensionInfo.list_extensions_versionc C s t �dtj| f�S )N�/)r �joinr r )r1 r r r � extension_docX s zExtensionInfo.extension_docc C s&