HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //opt/osm/venv/lib/python3.10/site-packages/pip/_internal/index/__pycache__/sources.cpython-310.pyc
o

5i�!�@sFddlmZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZm
Z
mZmZmZddlmZddlmZdd	lmZmZdd
lmZe�e�ZeeZeeZe
egeefZe
ege fZ!Gdd�d�Z"d(dd�Z#Gdd�d�Z$Gdd�de"�Z%Gdd�de"�Z&Gdd�de"�Z'Gdd�de"�Z(d)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@s.eZdZeddd��Zd
dd�Zdd	d
�ZdS)�
LinkSource�return�Link | NonecC�t��)z,Returns the underlying link, if there's one.��NotImplementedError��self�r�I/opt/osm/venv/lib/python3.10/site-packages/pip/_internal/index/sources.py�link szLinkSource.link�FoundCandidatescCr)z9Candidates found by parsing an archive listing HTML file.rrrrr�page_candidates%�zLinkSource.page_candidates�
FoundLinkscCr)z,Links found by specifying archives directly.rrrrr�
file_links)rzLinkSource.file_linksN�rr�rr�rr)�__name__�
__module__�__qualname__�propertyrrrrrrrrs

r�file_url�strr�boolcCstj|dd�ddkS)NF)�strictrz	text/html)�	mimetypes�
guess_type)r'rrr�
_is_html_file.sr-c@s@eZdZdZddd�Zddd	�Zeddd��Zeddd��ZdS)�_FlatDirectoryToUrlsz"Scans directory and caches results�pathr(r�NonecCs ||_g|_tt�|_d|_dS)NF)�_path�_page_candidatesr�list�_project_name_to_urls�_scanned_directory)rr/rrr�__init__5s

z_FlatDirectoryToUrls.__init__cCs�t�|j�D]A}t|j�}t|�r|j�|�qz	t|j	�d}Wnt
y>z	t|j	�d}Wn
ty;YYqwYnw|j
|�|�qd|_dS)zrScans directory once and populates both page_candidates
        and project_name_to_urls at the same time
        rTN)�os�scandirr1r
r/r-r2�appendr
�namerr	rr4r5)r�entry�urlZproject_filenamerrr�_scan_directory;s"
���
z$_FlatDirectoryToUrls._scan_directory�	list[str]cC�|js|��|jS�N)r5r=r2rrrrrR�z$_FlatDirectoryToUrls.page_candidates�dict[str, list[str]]cCr?r@)r5r=r4rrrr�project_name_to_urlsYrAz)_FlatDirectoryToUrls.project_name_to_urlsN)r/r(rr0)rr0)rr>)rrB)	r#r$r%�__doc__r6r=r&rrCrrrrr.2s

r.c@sJeZdZUdZiZded<ddd�Zeddd��Zddd�Z	ddd�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�CandidatesFromPager/r(�project_namerr0cCsF||_t|�|_||jvr|j||_dSt|d�|_|j|j|<dS)N)r/)�_candidates_from_pager�
_project_namerF�
_path_to_urlsr.)rrGr/rIrrrr6ls

z_FlatDirectorySource.__init__rcCsdSr@rrrrrr|sz_FlatDirectorySource.linkrccs(�|jjD]}|�t|��EdHqdSr@)rLrrJr�rr<rrrr�s��z$_FlatDirectorySource.page_candidatesrccs$�|jj|jD]}t|�VqdSr@)rLrCrKrrMrrrr�s��z_FlatDirectorySource.file_linksN)rGrHr/r(rIr(rr0r r!r")r#r$r%rDrF�__annotations__r6r&rrrrrrrrEas


rEc@�<eZdZdZddd	�Zeddd��Zddd�Zddd�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.
    rGrHrrrr0cC�||_||_dSr@�rJ�_link�rrGrrrrr6��
z_LocalFileSource.__init__rcC�|jSr@�rSrrrrr�rz_LocalFileSource.linkrccs(�t|jj�s	dS|�|j�EdHdSr@)r-rSr<rJrrrrr���z _LocalFileSource.page_candidatesrccs�t|jj�r	dS|jVdSr@)r-rSr<rrrrr�s�z_LocalFileSource.file_linksN�rGrHrrrr0r r!r"�	r#r$r%rDr6r&rrrrrrrrP�s
	
rPc@s<eZdZdZdd
d�Zedd
d��Zddd�Zddd�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.
    rGrH�page_validator�
PageValidatorrrrr0cCs||_||_||_dSr@)rJ�_page_validatorrS)rrGr\rrrrr6�s
z_RemoteFileSource.__init__rcCrVr@rWrrrrr�rz_RemoteFileSource.linkrccs(�|�|j�s	dS|�|j�EdHdSr@)r^rSrJrrrrr�rXz!_RemoteFileSource.page_candidatesrccs�|jVdSr@rWrrrrr�s�z_RemoteFileSource.file_linksN)rGrHr\r]rrrr0r r!r"rZrrrrr[�s


r[c@rO)�_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.
    rGrHrrrr0cCrQr@rRrTrrrr6�rUz_IndexDirectorySource.__init__rcCrVr@rWrrrrr�rz_IndexDirectorySource.linkrccs�|�|j�EdHdSr@rRrrrrr�s�z%_IndexDirectorySource.page_candidatesrcCsdS)Nrrrrrrr�sz _IndexDirectorySource.file_linksNrYr r!r"rZrrrrr_�s

r_�locationrGrHr\r]�
expand_dir�cache_link_parsingrI�$tuple[str | None, LinkSource | None]c
Csd}d}tj�|�rt|�}|}n|�d�r|}t|�}nt|�r#|}|dur1d}t�||�dS|durDt	||t
||d�d�}	||	fStj�|�re|rWt|||d�}	||	fSt
|t
||d�d�}	||	fStj�|�ryt|t
||d�d�}	||	fSt�d|�|dfS)	Nzfile:zVLocation '%s' is ignored: it is either a non-existing path or lacks a specific scheme.)NN)rb)rGr\r)rGr/rI)rGrz?Location '%s' is ignored: it is neither a file nor a directory.)r7r/�existsr
�
startswithrr�logger�warningr[r�isdirrEr_�isfilerP)
r`rGr\rarbrIr/r<�msg�sourcerrr�build_source�s\	

�
��
�
�
��rl)r'r(rr))r`r(rGrHr\r]rar)rbr)rIr(rrc)*�
__future__r�loggingr+r7�collectionsr�collections.abcr�typingrZpip._vendor.packaging.utilsrrrr	r
�pip._internal.models.candidater�pip._internal.models.linkr�pip._internal.utils.urlsr
r�pip._internal.vcsr�	getLoggerr#rfrrrHr)r]rr-r.rErPr[r_rlrrrr�<module>s2

/(!