XylotrechusZ
3
�Re. � @ s� d dl Z d dlZd dlZd dlmZ d dlmZ d dlm Z m
Z
mZ d dlm
Z
d dlmZ d dlmZmZ er�d dlmZmZmZmZ d d lmZ d d
lmZ G dd� de
�ZdS )
� N)�parse)�WHEEL_EXTENSION)�redact_auth_from_url�split_auth_from_netloc�splitext)�KeyBasedCompareMixin)�MYPY_CHECK_RUNNING)�path_to_url�url_to_path)�Optional�Text�Tuple�Union)�HTMLPage)�Hashesc sP e Zd ZdZddddddgZd=� fd
d� Zdd
� Zdd� Zedd� �Z edd� �Z
edd� �Zedd� �Zedd� �Z
edd� �Zdd� Zedd� �Zed d!� �Zejd"�Zed#d$� �Zejd%�Zed&d'� �Zejd(�Zed)d*� �Zed+d,� �Zed-d.� �Zed/d0� �Zd1d2� Zed3d4� �Zed5d6� �Zed7d8� �Z ed9d:� �Z!d;d<� Z"� Z#S )>�Linkz?Represents a parsed link from a Package Index's simple URL
�_parsed_url�_url�
comes_from�requires_python�
yanked_reason�cache_link_parsingNTc s\ |j d�rt|�}tj|�| _|| _|| _|r2|nd| _|| _t t
| �j|t
d� || _dS )a�
:param url: url of the resource pointed to (href of the link)
:param comes_from: instance of HTMLPage where the link was found,
or string.
:param requires_python: String containing the `Requires-Python`
metadata field, specified in PEP 345. This may be specified by
a data-requires-python attribute in the HTML link tag, as
described in PEP 503.
:param yanked_reason: the reason the file has been yanked, if the
file has been yanked, or None if the file hasn't been yanked.
This is the value of the "data-yanked" attribute, if present, in
a simple repository HTML link. If the file has been yanked but
no reason was provided, this should be the empty string. See
PEP 592 for more information and the specification.
:param cache_link_parsing: A flag that is used elsewhere to determine
whether resources retrieved from this link
should be cached. PyPI index urls should
generally have this set to False, for
example.
z\\N)�key�defining_class)
�
startswithr �urllib_parse�urlsplitr r r r r �superr �__init__r )�self�urlr r r r )� __class__� ��/builddir/build/BUILDROOT/alt-python36-pip-20.2.4-5.el8.x86_64/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/models/link.pyr $ s
z
Link.__init__c C sF | j rdj| j �}nd}| jr4djt| j�| j|�S tt| j��S d S )Nz (requires-python:{})� z{} (from {}){})r �formatr r r �str)r �rpr"