File: //opt/cloudlinux/venv/lib64/python3.11/site-packages/distlib/__pycache__/index.cpython-311.pyc
�
    � h=Q  �                   ��   � d dl Z d dlZd dlZd dlZd dlZd dlZ	 d dlmZ n# e$ r	 d dl	mZ Y nw xY wddl
mZ ddlm
Z
mZmZmZmZmZ ddlmZmZ  ej        e�  �        ZdZdZ G d	� d
e�  �        ZdS )�    N)�Thread�   )�DistlibException)�HTTPBasicAuthHandler�Request�HTTPPasswordMgr�urlparse�build_opener�string_types)�zip_dir�ServerProxyzhttps://pypi.org/pypi�pypic                   �   � e Zd ZdZdZdd�Zd� Zd� Zd� Zd� Z	d	� Z
d
� Zdd�Zdd�Z
dd
�Z	 	 dd�Zd� Z	 dd�Z	 dd�Zdd�Zd� Zd� Zdd�ZdS )�PackageIndexzc
    This class represents a package index compatible with PyPI, the Python
    Package Index.
    s.   ----------ThIs_Is_tHe_distlib_index_bouNdaRY_$Nc                 ��  � |pt           | _        | �                    �   �          t          | j        �  �        \  }}}}}}|s|s|s|dvrt	          d| j        z  �  �        �d| _        d| _        d| _        d| _        t          t          j        d�  �        5 }dD ];}		 t          j
        |	dg||��  �        }
|
dk    r	|	| _         n�,# t          $ r Y �8w xY wddd�  �         dS # 1 swxY w Y   dS )	z�
        Initialise an instance.
        :param url: The URL of the index. If not specified, the URL for PyPI is
                    used.
        )�http�httpszinvalid repository: %sN�w)�gpg�gpg2z	--version��stdout�stderrr   )�
DEFAULT_INDEX�url�read_configurationr	   r   �password_handler�ssl_verifierr   �gpg_home�open�os�devnull�
subprocess�
check_call�OSError)�selfr   �scheme�netloc�path�params�query�frag�sink�s�rcs              �B/opt/cloudlinux/venv/lib/python3.11/site-packages/distlib/index.py�__init__zPackageIndex.__init__%   s~  � � �'�-������!�!�!�4<�T�X�4F�4F�1����f�e�T�� 	H�U� 	H�d� 	H�f�4E�&E�&E�"�#;�d�h�#F�G�G�G� $��� ��������
�
�"�*�c�
"�
"� 	�d� %� 
� 
���#�.��;�/?��6:�<� <� <�B��Q�w�w�#$����� �� � � � ��D�����	� 	� 	� 	� 	� 	� 	� 	� 	� 	� 	� 	���� 	� 	� 	� 	� 	� 	s6   �C!�&C�C!�
C�C!�C�C!�!C%�(C%c                 �"