Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/clselect/clselectpythonuser/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/clselect/clselectpythonuser/__pycache__/extensions.cpython-311.pyc

�

!�gx���ddlmZddlmZddlmZddlZddlZddlmZddl	Z	ddl
mZddlm
ZddlmZddlmZddlZejd	ej��ZGd
�de��ZGd�d
e��ZGd�de��ZdS)�)�print_function)�division)�absolute_importN)�client)�configparser)�SafeConfigParser)�
ExpatErrorz"^(?P<name>.+) \((?P<version>.+)\)$c�"��eZdZdZ�fd�Z�xZS)�PyPIRpcApiErrorze
    Generic error class that means that we cannot properly
    get information from xml rpc api
    c�^��tt|���d|z��dS)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__s  ��]/opt/cloudlinux/venv/lib64/python3.11/site-packages/clselect/clselectpythonuser/extensions.pyrzPyPIRpcApiError.__init__!s>���
�o�t�$�$�-�-�
)�,3�	
3�	4�	4�	4�	4�	4���__name__�
__module__�__qualname__�__doc__r�
__classcell__�rs@rrrsB���������4�4�4�4�4�4�4�4�4rrc�"��eZdZdZ�fd�Z�xZS)�PyPIMaintenanceExceptionz�
    Raised when PyPY returns 503 error, which means
    that service is unavailable temporary and we should try again later.
    c�X��tt|���d��dS)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
rr)rrs �rrz!PyPIMaintenanceException.__init__/s5���
�&��-�-�6�6�
?�	
�	
�	
�	
�	
rrrs@rrr*sB���������
�
�
�
�
�
�
�
�
rrc��eZdZdZd�Zd�Zd�Zd�Zed���Z	ed���Z
ed���Zed	���Zd
S)�
ExtensionInfozhttps://pypi.python.org/pypic�B�tj|j��|_dS�N)�	xmlrpclib�ServerProxy�url�_rpc)rs rrzExtensionInfo.__init__=s���)�$�(�3�3��	�	�	rc���	|j�|��|i|��S#tjtf$r!}tt
|�����d}~wtj$rD}|j	tjkrt���tt
|�����d}~wtj
$r}t|j���d}~wtj$r}t|j���d}~wwxYwr!)r%�__getattr__�socket�gaierrorr	r�strr"�
ProtocolError�errcode�httplib�SERVICE_UNAVAILABLEr�Fault�faultString�ssl�SSLError�strerror)r�method�args�kwargs�errs     r�	__get_rpczExtensionInfo.__get_rpc@s���	0�0�4�9�(�(��0�0�$�A�&�A�A�A�����,�	,�	,�	,�!�#�c�(�(�+�+�+������&�	,�	,�	,��{�g�9�9�9�.�0�0�0�!�#�c�(�(�+�+�+�������	3�	3�	3�!�#�/�2�2�2������|�	0�	0�	0�!�#�,�/�/�/�����	0���s8�"�C6�A�C6�&?B%�%C6�7C�C6�C1�1C6c�`�|�d��}t�|��S)N�
list_packages)�_ExtensionInfo__get_rpcr�extensions_docs�r�
extensionss  r�list_extensionszExtensionInfo.list_extensionsNs'���^�^�O�4�4�
��,�,�Z�8�8�8rc�:��t�fd�|D����S)Nc3�N�K�|]}|d��d|d��ifV�� dS)�versions�package_releasesTN)r;)�.0�	extensionrs  �r�	<genexpr>z8ExtensionInfo.list_extensions_version.<locals>.<genexpr>UsT�����1�1�!���T�^�^�<N�PY�[_�-`�-`� a�b�1�1�1�1�1�1r)�dictr=s` r�list_extensions_versionz%ExtensionInfo.list_extensions_versionRs=����1�1�1�1�%/�1�1�1�1�1�	1rc�P�t�dtj|f��S)N�/)r*�joinrr$)rEs r�
extension_doczExtensionInfo.extension_docXs���x�x��m�/��;�<�<�<rc�h�d�|D��}td�t||��D����S)Nc3�JK�|]}t�|��V��dSr!)rrL)rDrEs  rrFz0ExtensionInfo.extensions_docs.<locals>.<genexpr>^sD����-�-���+�+�I�6�6�-�-�-�-�-�-rc3�(K�|]
\}}|d|ifV��dS)�docN�)rDrErPs   rrFz0ExtensionInfo.extensions_docs.<locals>.<genexpr>`sK����A�A�&�	�3�����-�A�A�A�A�A�Ar)rG�zip)r>�docss  rr<zExtensionInfo.extensions_docs\s`��-�-�!+�-�-�-���A�A�*-�j�$�*?�*?�A�A�A�A�A�	Arc��|�dd��}tj�d|dd��}tj�|��sCtj�tj�t��dd��}tdd���}|�|��	|�	|��}n#tj$rd	}YnwxYwtd
�|D����S)N�.�z/opt/alt�etczlocked_extensions.iniz..F)�
interpolation�strictrQc3�^K�|](\}}|d�|�d��D��fV��)dS)c�:�g|]}|�|�����SrQ)�strip)rD�vs  r�
<listcomp>zAExtensionInfo.get_locked_extensions.<locals>.<genexpr>.<listcomp>ps%�� M� M� M�q�1� M������ M� M� Mr�,N)�split)rDrErBs   rrFz6ExtensionInfo.get_locked_extensions.<locals>.<genexpr>psZ����6�6�+�	�8�� M� M�H�N�N�3�4G�4G� M� M� M�N�6�6�6�6�6�6r)
�replace�os�pathrK�exists�dirname�__file__r�read�items�ConfigParser�NoSectionErrorrG)�interpreter�alt_ver�	file_path�parserrhs     r�get_locked_extensionsz#ExtensionInfo.get_locked_extensionscs���%�%�c�"�-�-���G�L�L��W�e�=T�U�U�	��w�~�~�i�(�(�	_�����R�W�_�_�X�%>�%>��F]�^�^�I�!��U�C�C�C�����I����	��L�L��-�-�E�E���*�	�	�	��E�E�E�	�����6�6�/4�6�6�6�6�6�	6s�C�C,�+C,c���||vo�tt�fd���d��D����t|�|����z��p%t	|�|����dkS)Nc�^��g|])}t���dk�|�����*S)r)�lenr\)rDr]�versions  �rr^z6ExtensionInfo.is_extensions_locked.<locals>.<listcomp>vs1���P�P�P�A�s�7�|�|�a�?O�?O�a�g�g�i�i�?O�?O�?Orr_r)�list�setr`�getrr)�locked_extensionsrErss  `r�is_extensions_lockedz"ExtensionInfo.is_extensions_lockedss�����.�.�
���P�P�P�P����s�);�);�P�P�P�Q�Q��'�+�+�I�6�6�7�7�8�
9�
9�
7��!�%�%�i�0�0�1�1�Q�6�	rN)
rrrr$rr;r?rH�staticmethodrLr<rorxrQrrrr9s�������
(�C�4�4�4�0�0�0�9�9�9�1�1�1��=�=��\�=��A�A��\�A��
6�
6��\�
6�����\���rr)�
__future__rrrrb�re�future.moves.httprr-r(�future.moves.xmlrpcr"�future.movesrri�future.moves.configparserr�pyexpatr	r1�compile�	MULTILINE�EXTENSION_PATTERN�	Exceptionrr�objectrrQrr�<module>r�sk��&�%�%�%�%�%�������&�&�&�&�&�&�	�	�	�	�	�	�	�	�/�/�/�/�/�/�
�
�
�
�3�3�3�3�3�3�5�5�5�5�5�5�6�6�6�6�6�6�������
�
�
�
��B�J�C�!�|�-�-��4�4�4�4�4�i�4�4�4�
�
�
�
�
��
�
�
�@�@�@�@�@�F�@�@�@�@�@r

Hacked By AnonymousFox1.0, Coded By AnonymousFox