HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/Python311/Lib/site-packages/pip/_internal/index/__pycache__/sources.cpython-311.pyc
�

�mi�!����ddlmZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZm
Z
mZmZmZddlmZddlmZdd	lmZmZdd
lmZeje��ZeeZeeZe
egeefZe
ege fZ!Gd�d��Z"d&d�Z#Gd�d��Z$Gd�de"��Z%Gd�de"��Z&Gd�de"��Z'Gd�de"��Z(d'd%�Z)dS)(�)�annotationsN)�defaultdict)�Iterable)�Callable)�InvalidSdistFilename�InvalidWheelFilename�canonicalize_name�parse_sdist_filename�parse_wheel_filename)�InstallationCandidate)�Link)�path_to_url�url_to_path)�is_urlc�6�eZdZed	d���Zd
d�Zdd�ZdS)�
LinkSource�return�Link | Nonec��t���)z,Returns the underlying link, if there's one.��NotImplementedError��selfs �=D:\Python311\Lib\site-packages\pip/_internal/index/sources.py�linkzLinkSource.link s��"�#�#�#��FoundCandidatesc��t���)z9Candidates found by parsing an archive listing HTML file.rrs r�page_candidateszLinkSource.page_candidates%���!�#�#�#r�
FoundLinksc��t���)z,Links found by specifying archives directly.rrs r�
file_linkszLinkSource.file_links)r rN�rr�rr�rr!)�__name__�
__module__�__qualname__�propertyrrr#�rrrrsZ������
�$�$�$��X�$�$�$�$�$�$�$�$�$�$�$rr�file_url�strr�boolc�B�tj|d���ddkS)NF)�strictrz	text/html)�	mimetypes�
guess_type)r,s r�
_is_html_filer3.s"������7�7�7��:�k�I�Irc�R�eZdZdZd
d�Zdd�Zedd	���Zedd���ZdS)�_FlatDirectoryToUrlsz"Scans directory and caches results�pathr-r�Nonec�b�||_g|_tt��|_d|_dS)NF)�_path�_page_candidatesr�list�_project_name_to_urls�_scanned_directory)rr6s  r�__init__z_FlatDirectoryToUrls.__init__5s/����
�+-���;F�t�;L�;L��"�"'����rc��tj|j��D]�}t|j��}t|��r|j�|���@	t|j	��d}n=#t$r0	t|j	��d}n#t$rYY��wxYwYnwxYw|j
|�|����d|_dS)zrScans directory once and populates both page_candidates
        and project_name_to_urls at the same time
        rTN)�os�scandirr9rr6r3r:�appendr�namerr
rr<r=)r�entry�url�project_filenames    r�_scan_directoryz$_FlatDirectoryToUrls._scan_directory;s	���Z��
�+�+�	E�	E�E��e�j�)�)�C��S�!�!�
��%�,�,�S�1�1�1��
�#7��
�#C�#C�A�#F� � ��'�
�
�
��';�E�J�'G�'G��'J�$�$��+�����H�H�����%�$�
����
�&�'7�8�?�?��D�D�D�D�"&����s6�A6�6
B0�B�B0�
B*�&B0�)B*�*B0�/B0�	list[str]c�F�|js|���|jS�N)r=rGr:rs rrz$_FlatDirectoryToUrls.page_candidatesRs(���&�	#�� � �"�"�"��$�$r�dict[str, list[str]]c�F�|js|���|jSrJ)r=rGr<rs r�project_name_to_urlsz)_FlatDirectoryToUrls.project_name_to_urlsYs(���&�	#�� � �"�"�"��)�)rN)r6r-rr7)rr7)rrH)rrK)	r'r(r)�__doc__r>rGr*rrMr+rrr5r52s�������,�,�(�(�(�(�'�'�'�'�.�%�%�%��X�%��*�*�*��X�*�*�*rr5c�R�eZdZUdZiZded<dd�Zedd
���Zdd�Z	dd�Z
dS)�_FlatDirectorySourcez�Link source specified by ``--find-links=<path-to-dir>``.

    This looks the content of the directory, and returns:

    * ``page_candidates``: Links listed on each HTML file in the directory.
    * ``file_candidates``: Archives in the directory.
    zdict[str, _FlatDirectoryToUrls]�_paths_to_urls�candidates_from_page�CandidatesFromPager6r-�project_namerr7c��||_t|��|_||jvr|j||_dSt|���|_|j|j|<dS)N)r6)�_candidates_from_pager	�
_project_namerQ�
_path_to_urlsr5)rrRr6rTs    rr>z_FlatDirectorySource.__init__lsm��&:��"�.�|�<�<����4�&�&�	;�!%�!4�T�!:�D����!5�4�!@�!@�!@�D��(,�(:�D���%�%�%rrc��dSrJr+rs rrz_FlatDirectorySource.link|s���trrc#�xK�|jjD]*}|�t|����Ed{V���+dSrJ)rXrrVr
�rrEs  rrz$_FlatDirectorySource.page_candidates�sT�����%�5�	=�	=�C��1�1�$�s�)�)�<�<�<�<�<�<�<�<�<�<�	=�	=rr!c#�`K�|jj|jD]}t|��V��dSrJ)rXrMrWr
r[s  rr#z_FlatDirectorySource.file_links�s>�����%�:�4�;M�N�	�	�C��s�)�)�O�O�O�O�	�	rN)rRrSr6r-rTr-rr7r$r%r&)r'r(r)rNrQ�__annotations__r>r*rrr#r+rrrPrPas����������79�N�8�8�8�8�;�;�;�;� �����X��=�=�=�=������rrPc�B�eZdZdZdd�Zedd
���Zdd�Zdd�ZdS)�_LocalFileSourceaC``--find-links=<path-or-url>`` or ``--[extra-]index-url=<path-or-url>``.

    If a URL is supplied, it must be a ``file:`` URL. If a path is supplied to
    the option, it is converted to a URL first. This returns:

    * ``page_candidates``: Links listed on an HTML file.
    * ``file_candidates``: The non-HTML file.
    rRrSrr
rr7c�"�||_||_dSrJ�rV�_link�rrRrs   rr>z_LocalFileSource.__init__����
&:��"���
�
�
rrc��|jSrJ�rbrs rrz_LocalFileSource.link��
���z�rrc#�K�t|jj��sdS|�|j��Ed{V��dSrJ)r3rbrErVrs rrz _LocalFileSource.page_candidates�sM�����T�Z�^�,�,�	��F��-�-�d�j�9�9�9�9�9�9�9�9�9�9�9rr!c#�RK�t|jj��rdS|jV�dSrJ)r3rbrErs rr#z_LocalFileSource.file_links�s3��������(�(�	��F��j�����rN�rRrSrr
rr7r$r%r&�	r'r(r)rNr>r*rrr#r+rrr_r_�sz�����������������X��:�:�:�:�
�����rr_c�B�eZdZdZdd
�Zedd���Zdd�Zdd�ZdS)�_RemoteFileSourcez�``--find-links=<url>`` or ``--[extra-]index-url=<url>``.

    This returns:

    * ``page_candidates``: Links listed on an HTML file.
    * ``file_candidates``: The non-HTML file.
    rRrS�page_validator�
PageValidatorrr
rr7c�0�||_||_||_dSrJ)rV�_page_validatorrb)rrRrnrs    rr>z_RemoteFileSource.__init__�s��&:��"�-�����
�
�
rrc��|jSrJrfrs rrz_RemoteFileSource.link�rgrrc#�K�|�|j��sdS|�|j��Ed{V��dSrJ)rqrbrVrs rrz!_RemoteFileSource.page_candidates�sQ�����#�#�D�J�/�/�	��F��-�-�d�j�9�9�9�9�9�9�9�9�9�9�9rr!c#�K�|jV�dSrJrfrs rr#z_RemoteFileSource.file_links�s�����j�����rN)rRrSrnrorr
rr7r$r%r&rkr+rrrmrm�sz�����������������X��:�:�:�:�
�����rrmc�B�eZdZdZdd�Zedd
���Zdd�Zdd�ZdS)�_IndexDirectorySourcez�``--[extra-]index-url=<path-to-directory>``.

    This is treated like a remote URL; ``candidates_from_page`` contains logic
    for this by appending ``index.html`` to the link.
    rRrSrr
rr7c�"�||_||_dSrJrarcs   rr>z_IndexDirectorySource.__init__�rdrrc��|jSrJrfrs rrz_IndexDirectorySource.link�rgrrc#�JK�|�|j��Ed{V��dSrJrars rrz%_IndexDirectorySource.page_candidates�s4�����-�-�d�j�9�9�9�9�9�9�9�9�9�9�9rr!c��dS)Nr+r+rs rr#z _IndexDirectorySource.file_links�s���rrNrjr$r%r&rkr+rrrvrv�sz�����������������X��:�:�:�:������rrv�locationrRrSrnro�
expand_dir�cache_link_parsingrT�$tuple[str | None, LinkSource | None]c���d}d}tj�|��rt|��}|}n8|�d��r|}t|��}nt
|��r|}|�d}t�||��dS|�%t||t||������}	||	fStj�|��r9|rt|||���}	n t|t||������}	||	fStj�|��r$t|t||������}	||	fSt�d|��|dfS)	Nzfile:zVLocation '%s' is ignored: it is either a non-existing path or lacks a specific scheme.)NN)r})rRrnr)rRr6rT)rRrz?Location '%s' is ignored: it is neither a file nor a directory.)r@r6�existsr�
startswithrr�logger�warningrmr
�isdirrPrv�isfiler_)
r{rRrnr|r}rTr6rE�msg�sources
          r�build_sourcer��s����D��C�	�w�~�~�h�����(�#�#�����	�	�	�W�	%�	%�����8�$�$���	��	�	����
��
K�	�	���s�H�%�%�%��|���.�!5�)��c�.@�A�A�A�
�
�
��
�V�}��	�w�}�}�T�����
	�)�%9��)����F�F�+�%9��#�2D�E�E�E����F��V�}��	�����	�	��!�!5��c�.@�A�A�A�
�
�
���V�}��
�N�N�I�����
��;�r)r,r-rr.)r{r-rRrSrnror|r.r}r.rTr-rr~)*�
__future__r�loggingr1r@�collectionsr�collections.abcr�typingr�pip._vendor.packaging.utilsrrr	r
r�pip._internal.models.candidater�pip._internal.models.linkr
�pip._internal.utils.urlsrr�pip._internal.vcsr�	getLoggerr'r�rr!rSr.rorr3r5rPr_rmrvr�r+rr�<module>r�s���"�"�"�"�"�"���������	�	�	�	�#�#�#�#�#�#�$�$�$�$�$�$���������������������A�@�@�@�@�@�*�*�*�*�*�*�=�=�=�=�=�=�=�=�$�$�$�$�$�$�	��	�8�	$�	$���0�1��
�d�^�
��t�f�h�/D�&E�E�F���$����&�
�$�$�$�$�$�$�$�$�J�J�J�J�,*�,*�,*�,*�,*�,*�,*�,*�^%�%�%�%�%�:�%�%�%�P�����z����B�����
����@�����J����4;�;�;�;�;�;r