HEX
Server: LiteSpeed
System: Linux server.nevid-deploma.com 4.18.0-553.111.1.lve.el8.x86_64 #1 SMP Fri Mar 13 13:42:17 UTC 2026 x86_64
User: smilepac (1037)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/cppython/lib/python3.8/site-packages/pip/_internal/index/__pycache__/sources.cpython-38.pyc
U

>D�g�!�
@shddlZddlZddlZddlmZddlmZmZmZm	Z	m
Z
mZddlm
Z
mZmZmZmZddlmZddlmZddlmZmZddlmZe�e�ZeeZeeZeegeefZ eege!fZ"Gd	d
�d
�Z#e$e!d�dd
�Z%Gdd�d�Z&Gdd�de#�Z'Gdd�de#�Z(Gdd�de#�Z)Gdd�de#�Z*e$e e"e!e!e$ee
e$e
e#fd�dd�Z+dS)�N)�defaultdict)�Callable�Dict�Iterable�List�Optional�Tuple)�InvalidSdistFilename�InvalidWheelFilename�canonicalize_name�parse_sdist_filename�parse_wheel_filename)�InstallationCandidate)�Link)�path_to_url�url_to_path)�is_urlc@s>eZdZeeed�dd��Zed�dd�Ze	d�dd�Z
dS)	�
LinkSource��returncCs
t��dS)z,Returns the underlying link, if there's one.N��NotImplementedError��self�r�H/opt/cppython/lib/python3.8/site-packages/pip/_internal/index/sources.py�linkszLinkSource.linkcCs
t��dS)z9Candidates found by parsing an archive listing HTML file.Nrrrrr�page_candidates"szLinkSource.page_candidatescCs
t��dS)z,Links found by specifying archives directly.Nrrrrr�
file_links&szLinkSource.file_linksN)�__name__�
__module__�__qualname__�propertyrrr�FoundCandidatesr�
FoundLinksrrrrrrsr)�file_urlrcCstj|dd�ddkS)NF)�strictrz	text/html)�	mimetypes�
guess_type)r%rrr�
_is_html_file+sr)c@sbeZdZdZedd�dd�Zdd�dd�Zeeed�d	d
��Z	ee
eeefd�dd��ZdS)
�_FlatDirectoryToUrlsz"Scans directory and caches resultsN)�pathrcCs ||_g|_tt�|_d|_dS)NF)�_path�_page_candidatesr�list�_project_name_to_urls�_scanned_directory)rr+rrr�__init__2s
z_FlatDirectoryToUrls.__init__rcCs�t�|j�D]�}t|j�}t|�r0|j�|�qzt|j	�d}WnBt
k
r�zt|j	�d}Wntk
r~YYqYnXYnX|j
|�|�qd|_dS)zrScans directory once and populates both page_candidates
        and project_name_to_urls at the same time
        rTN)�os�scandirr,rr+r)r-�appendr
�namer
rr	r/r0)r�entry�urlZproject_filenamerrr�_scan_directory8s
z$_FlatDirectoryToUrls._scan_directorycCs|js|��|jS�N)r0r8r-rrrrrOsz$_FlatDirectoryToUrls.page_candidatescCs|js|��|jSr9)r0r8r/rrrr�project_name_to_urlsVsz)_FlatDirectoryToUrls.project_name_to_urls)rr r!�__doc__�strr1r8r"rrrr:rrrrr*/sr*c@sleZdZUdZiZeeefed<e	eedd�dd�Z
eee
d�dd	��Zed�d
d�Zed�dd
�ZdS)�_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.
    �_paths_to_urlsN)�candidates_from_pager+�project_namercCsD||_t|�|_||jkr(|j||_nt|d�|_|j|j|<dS)N)r+)�_candidates_from_pager�
_project_namer>�
_path_to_urlsr*)rr?r+r@rrrr1is

z_FlatDirectorySource.__init__rcCsdSr9rrrrrrysz_FlatDirectorySource.linkccs&|jjD]}|�t|��EdHqdSr9)rCrrAr�rr7rrrr}sz$_FlatDirectorySource.page_candidatesccs"|jj|jD]}t|�VqdSr9)rCr:rBrrDrrrr�sz_FlatDirectorySource.file_links)rr r!r;r>rr<r*�__annotations__�CandidatesFromPager1r"rrrr#rr$rrrrrr=^s
�r=c@sTeZdZdZeedd�dd�Zeeed�dd��Z	e
d�d	d
�Zed�dd�Z
dS)
�_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.
    N�r?rrcCs||_||_dSr9�rA�_link�rr?rrrrr1�sz_LocalFileSource.__init__rcCs|jSr9�rJrrrrr�sz_LocalFileSource.linkccs&t|jj�sdS|�|j�EdHdSr9)r)rJr7rArrrrr�sz _LocalFileSource.page_candidatesccst|jj�rdS|jVdSr9)r)rJr7rrrrr�sz_LocalFileSource.file_links�rr r!r;rFrr1r"rrr#rr$rrrrrrG�s�rGc@sVeZdZdZeeedd�dd�Zee	ed�dd��Z
ed�d	d
�Ze
d�dd�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.
    N)r?�page_validatorrrcCs||_||_||_dSr9)rA�_page_validatorrJ)rr?rOrrrrr1�sz_RemoteFileSource.__init__rcCs|jSr9rLrrrrr�sz_RemoteFileSource.linkccs&|�|j�sdS|�|j�EdHdSr9)rPrJrArrrrr�sz!_RemoteFileSource.page_candidatesccs|jVdSr9rLrrrrr�sz_RemoteFileSource.file_links)rr r!r;rF�
PageValidatorrr1r"rrr#rr$rrrrrrN�s
�
rNc@sTeZdZdZeedd�dd�Zeeed�dd��Z	e
d�d	d
�Zed�dd�Z
dS)
�_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.
    NrHcCs||_||_dSr9rIrKrrrr1�sz_IndexDirectorySource.__init__rcCs|jSr9rLrrrrr�sz_IndexDirectorySource.linkccs|�|j�EdHdSr9rIrrrrr�sz%_IndexDirectorySource.page_candidatescCsdS)Nrrrrrrr�sz _IndexDirectorySource.file_linksrMrrrrrR�s�rR)�locationr?rO�
expand_dir�cache_link_parsingr@rc
Csd}d}tj�|�r"t|�}|}n$|�d�r:|}t|�}nt|�rF|}|dkrbd}t�||�dS|dkr�t	||t
||d�d�}	||	fStj�|�r�|r�t|||d�}	nt
|t
||d�d�}	||	fStj�|�r�t|t
||d�d�}	||	fSt�d|�|dfS)	Nzfile:zVLocation '%s' is ignored: it is either a non-existing path or lacks a specific scheme.)NN)rU)r?rOr)r?r+r@)r?rz?Location '%s' is ignored: it is neither a file nor a directory.)r2r+�existsr�
startswithrr�logger�warningrNr�isdirr=rR�isfilerG)
rSr?rOrTrUr@r+r7�msg�sourcerrr�build_source�sZ	

�
��
�
��r^),�loggingr'r2�collectionsr�typingrrrrrrZpip._vendor.packaging.utilsr	r
rrr
�pip._internal.models.candidater�pip._internal.models.linkr�pip._internal.utils.urlsrr�pip._internal.vcsr�	getLoggerrrXr#r$rF�boolrQrr<r)r*r=rGrNrRr^rrrr�<module>s: 
/(! �