JFIF$        dd7 

Viewing File: /usr/lib/python3.9/site-packages/pip/_internal/index/__pycache__/sources.cpython-39.opt-1.pyc

a

[��f��	@s0ddlZddlZddlZddlZddlmZmZmZmZddl	m
Z
ddlmZddl
mZmZddlmZe�e�Zee
ZeeZeegee
fZeegefZGdd�d�Zeed	�d
d�ZGdd
�d
e�ZGdd�de�ZGdd�de�ZGdd�de�Z eeeeeeeeeefd�dd�Z!dS)�N)�Callable�Iterable�Optional�Tuple)�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�?/usr/lib/python3.9/site-packages/pip/_internal/index/sources.py�linkszLinkSource.linkcCs
t��dS)z9Candidates found by parsing an archive listing HTML file.Nrrrrr�page_candidatesszLinkSource.page_candidatescCs
t��dS)z,Links found by specifying archives directly.Nrrrrr�
file_linksszLinkSource.file_linksN)�__name__�
__module__�__qualname__�propertyrrr�FoundCandidatesr�
FoundLinksrrrrrrsr)�file_urlr
cCstj|dd�ddkS)NF)�strictrz	text/html)�	mimetypesZ
guess_type)rrrr�
_is_html_file#sr c@sTeZdZdZeedd�dd�Zeee	d�dd��Z
ed�d	d
�Ze
d�dd�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.
    N)�candidates_from_page�pathr
cCs||_t�tj�|��|_dS�N)�_candidates_from_page�pathlib�Path�osr#�realpath�_path)rr"r#rrr�__init__0sz_FlatDirectorySource.__init__rcCsdSr$rrrrrr8sz_FlatDirectorySource.linkccs>|j��D].}tt|��}t|�s$q
|�t|��EdHq
dSr$)r*�iterdirr�strr r%r�rr#�urlrrrr<s
z$_FlatDirectorySource.page_candidatesccs4|j��D]$}tt|��}t|�r$q
t|�Vq
dSr$)r*r,rr-r rr.rrrrCs
z_FlatDirectorySource.file_links)rrr�__doc__�CandidatesFromPager-r+rrrrrrrrrrrrr!'s
�r!c@sTeZdZdZeedd�dd�Zeeed�dd��Z	e
d�d	d
�Zed�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"rr
cCs||_||_dSr$�r%�_link�rr"rrrrr+Usz_LocalFileSource.__init__rcCs|jSr$�r5rrrrr]sz_LocalFileSource.linkccs&t|jj�sdS|�|j�EdHdSr$)r r5r/r%rrrrrasz _LocalFileSource.page_candidatesccst|jj�rdS|jVdSr$)r r5r/rrrrrfsz_LocalFileSource.file_links�rrrr0r1rr+rrrrrrrrrrrr2Ks�r2c@sVeZdZdZeeedd�dd�Zee	ed�dd��Z
ed�d	d
�Ze
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_validatorrr
cCs||_||_||_dSr$)r%�_page_validatorr5)rr"r:rrrrr+usz_RemoteFileSource.__init__rcCs|jSr$r7rrrrrsz_RemoteFileSource.linkccs&|�|j�sdS|�|j�EdHdSr$)r;r5r%rrrrr�sz!_RemoteFileSource.page_candidatesccs|jVdSr$r7rrrrr�sz_RemoteFileSource.file_links)rrrr0r1�
PageValidatorrr+rrrrrrrrrrrr9ls
�
r9c@sTeZdZdZeedd�dd�Zeeed�dd��Z	e
d�d	d
�Zed�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.
    Nr3cCs||_||_dSr$r4r6rrrr+�sz_IndexDirectorySource.__init__rcCs|jSr$r7rrrrr�sz_IndexDirectorySource.linkccs|�|j�EdHdSr$r4rrrrr�sz%_IndexDirectorySource.page_candidatescCsdS)Nrrrrrrr�sz _IndexDirectorySource.file_linksr8rrrrr=�s�r=)�locationr"r:�
expand_dir�cache_link_parsingr
c	Cs�d}d}tj�|�r"t|�}|}n$|�d�r:|}t|�}nt|�rF|}|durbd}t�||�dS|dur�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)r@)r"r:r)r"r#)r"rz?Location '%s' is ignored: it is neither a file nor a directory.)r(r#�existsr�
startswithr	r
�loggerZwarningr9r�isdirr!r=�isfiler2)	r>r"r:r?r@r#r/�msg�sourcerrr�build_source�sX	

�
��
�
��rH)"Zloggingrr(r&�typingrrrrZpip._internal.models.candidaterZpip._internal.models.linkrZpip._internal.utils.urlsrr	Zpip._internal.vcsr
Z	getLoggerrrCrrr1�boolr<rr-r r!r2r9r=rHrrrr�<module>s4
$! �
Back to Directory  nL+D550H?Mx ,D"v]qv;6*Zqn)ZP0!1 A "#a$2Qr D8 a Ri[f\mIykIw0cuFcRı?lO7к_f˓[C$殷WF<_W ԣsKcëIzyQy/_LKℂ;C",pFA:/]=H  ~,ls/9ć:[=/#f;)x{ٛEQ )~ =𘙲r*2~ a _V=' kumFD}KYYC)({ *g&f`툪ry`=^cJ.I](*`wq1dđ#̩͑0;H]u搂@:~וKL Nsh}OIR*8:2 !lDJVo(3=M(zȰ+i*NAr6KnSl)!JJӁ* %݉?|D}d5:eP0R;{$X'xF@.ÊB {,WJuQɲRI;9QE琯62fT.DUJ;*cP A\ILNj!J۱+O\͔]ޒS߼Jȧc%ANolՎprULZԛerE2=XDXgVQeӓk yP7U*omQIs,K`)6\G3t?pgjrmۛجwluGtfh9uyP0D;Uڽ"OXlif$)&|ML0Zrm1[HXPlPR0'G=i2N+0e2]]9VTPO׮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