관리-도구
편집 파일: sources.cpython-39.opt-1.pyc
a ����[��f�������������������� ���@���s0��d�dl�Z�d�dlZd�dlZd�dlZd�dlmZmZmZmZ�d�dl m Z �d�dlmZ�d�dl mZmZ�d�dlmZ�e��e�Zee �Zee�Zeegee �f�Zeegef�ZG�dd��d�Zeed �d d�ZG�dd ��d e�ZG�dd��de�ZG�dd��de�ZG�dd��de�Z eeeeeeee�ee�f�d�dd�Z!dS�)�����N)�Callable�Iterable�Optional�Tuple)�InstallationCandidate)�Link)�path_to_url�url_to_path)�is_urlc�������������������@���s>���e�Zd�Zeee�d�dd��Zed�dd�Ze d�dd�Z dS�) � LinkSource��returnc�����������������C���s ���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�link���s����zLinkSource.linkc�����������������C���s ���t����dS�)z9Candidates found by parsing an archive listing HTML file.Nr���r���r���r���r����page_candidates���s����zLinkSource.page_candidatesc�����������������C���s ���t����dS�)z,Links found by specifying archives directly.Nr���r���r���r���r���� file_links���s����zLinkSource.file_linksN)�__name__� __module__�__qualname__�propertyr���r���r����FoundCandidatesr���� FoundLinksr���r���r���r���r���r������s���r���)�file_urlr ���c�����������������C���s���t�j|�dd�d�dkS�)NF)�strictr���z text/html)� mimetypesZ guess_type)r���r���r���r���� _is_html_file#���s����r ���c�������������������@���sT���e�Zd�ZdZeedd�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 ���c�����������������C���s���||�_�t�tj�|��|�_d�S��N)�_candidates_from_page�pathlib�Path�osr#����realpath�_path)r���r"���r#���r���r���r����__init__0���s����z_FlatDirectorySource.__init__r���c�����������������C���s���d�S�r$���r���r���r���r���r���r���8���s����z_FlatDirectorySource.linkc�����������������c���s>���|�j����D�].}tt|��}t|�s$q |��t|��E�d�H��q d�S�r$���)r*����iterdirr����strr ���r%���r����r���r#����urlr���r���r���r���<���s ����z$_FlatDirectorySource.page_candidatesc�����������������c���s4���|�j����D�]$}tt|��}t|�r$q t|�V��q d�S�r$���)r*���r,���r���r-���r ���r���r.���r���r���r���r���C���s ����z_FlatDirectorySource.file_links)r���r���r����__doc__�CandidatesFromPager-���r+���r���r���r���r���r���r���r���r���r���r���r���r���r!���'���s��� �r!���c�������������������@���sT���e�Zd�ZdZeedd�dd�Zeee�d�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"���r���r ���c�����������������C���s���||�_�||�_d�S�r$����r%����_link�r���r"���r���r���r���r���r+���U���s����z_LocalFileSource.__init__r���c�����������������C���s���|�j�S�r$����r5���r���r���r���r���r���]���s����z_LocalFileSource.linkc�����������������c���s&���t�|�jj�sd�S�|��|�j�E�d�H��d�S�r$���)r ���r5���r/���r%���r���r���r���r���r���a���s����z _LocalFileSource.page_candidatesc�����������������c���s���t�|�jj�rd�S�|�jV��d�S�r$���)r ���r5���r/���r���r���r���r���r���f���s����z_LocalFileSource.file_links�r���r���r���r0���r1���r���r+���r���r���r���r���r���r���r���r���r���r���r���r2���K���s����r2���c�������������������@���sV���e�Zd�ZdZeeedd�dd�Zee e�d�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_validatorr���r ���c�����������������C���s���||�_�||�_||�_d�S�r$���)r%����_page_validatorr5���)r���r"���r:���r���r���r���r���r+���u���s����z_RemoteFileSource.__init__r���c�����������������C���s���|�j�S�r$���r7���r���r���r���r���r������s����z_RemoteFileSource.linkc�����������������c���s&���|���|�j�sd�S�|��|�j�E�d�H��d�S�r$���)r;���r5���r%���r���r���r���r���r�������s����z!_RemoteFileSource.page_candidatesc�����������������c���s���|�j�V��d�S�r$���r7���r���r���r���r���r�������s����z_RemoteFileSource.file_links)r���r���r���r0���r1���� PageValidatorr���r+���r���r���r���r���r���r���r���r���r���r���r���r9���l���s��� � r9���c�������������������@���sT���e�Zd�ZdZeedd�dd�Zeee�d�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. Nr3���c�����������������C���s���||�_�||�_d�S�r$���r4���r6���r���r���r���r+�������s����z_IndexDirectorySource.__init__r���c�����������������C���s���|�j�S�r$���r7���r���r���r���r���r�������s����z_IndexDirectorySource.linkc�����������������c���s���|���|�j�E�d�H��d�S�r$���r4���r���r���r���r���r�������s����z%_IndexDirectorySource.page_candidatesc�����������������C���s���dS�)Nr���r���r���r���r���r���r�������s����z _IndexDirectorySource.file_linksr8���r���r���r���r���r=�������s����r=���)�locationr"���r:���� expand_dir�cache_link_parsingr ���c���������� ������C���s����d�}d�}t�j�|��r"t|��}|�}n$|��d�r:|�}t|��}nt|��rF|�}|d�u�rbd}t�||���dS�|d�u�r�t ||t ||d�d�}||fS�t�j�|�r�|r�t||d�}nt |t ||d�d�}||fS�t�j�|�r�t|t ||d�d�}||fS�t�d|���|d�fS�) 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"���r���z?Location '%s' is ignored: it is neither a file nor a directory.)r(���r#����existsr���� startswithr ���r ����loggerZwarningr9���r����isdirr!���r=����isfiler2���) r>���r"���r:���r?���r@���r#���r/����msg�sourcer���r���r����build_source����sX���� � �� � ��rH���)"Zloggingr���r(���r&����typingr���r���r���r���Zpip._internal.models.candidater���Zpip._internal.models.linkr���Zpip._internal.utils.urlsr���r ���Zpip._internal.vcsr ���Z getLoggerr���rC���r���r���r1����boolr<���r���r-���r ���r!���r2���r9���r=���rH���r���r���r���r����<module>���s4��� $! �