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: //usr/lib/python3.9/site-packages/pip/_internal/models/__pycache__/link.cpython-39.pyc
a

?�f.�@s�ddlZddlZddlZddlmZddlmZddlm	Z	m
Z
mZddlm
Z
ddlmZddlmZmZer�ddlmZmZmZmZdd	lmZdd
lmZGdd�de
�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)�HashescsHeZdZdZgd�Zd8�fdd�	Zdd�Zd	d
�Zedd��Z	ed
d��Z
edd��Zedd��Zedd��Z
edd��Zdd�Zedd��Zedd��Ze�d�Zedd��Ze�d �Zed!d"��Ze�d#�Zed$d%��Zed&d'��Zed(d)��Zed*d+��Zd,d-�Zed.d/��Zed0d1��Zed2d3��Z ed4d5��Z!d6d7�Z"�Z#S)9�Linkz?Represents a parsed link from a Package Index's simple URL
    )�_parsed_url�_url�
comes_from�requires_python�
yanked_reason�cache_link_parsingNTcs\|�d�rt|�}t�|�|_||_||_|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)�keyZdefining_class)
�
startswithr	�urllib_parse�urlsplitrrrrr�superr�__init__r)�self�urlrrrr��	__class__��=/usr/lib/python3.9/site-packages/pip/_internal/models/link.pyr$s
z
Link.__init__cCsF|jrd�|j�}nd}|jr4d�t|j�|j|�Stt|j��SdS)Nz (requires-python:{})�z{} (from {}){})r�formatrrr�str)rZrpr"r"r#�__str__Ss�zLink.__str__cCs
d�|�S)Nz	<Link {}>)r%�rr"r"r#�__repr___sz
Link.__repr__cCs|jS�N)rr(r"r"r#rcszLink.urlcCsT|j�d�}t�|�}|s,t|j�\}}|St�|�}|sPJdjfit	�����|S)N�/z&URL {self._url!r} produced no filename)
�path�rstrip�	posixpath�basenamer�netlocr�unquoter%�locals)rr,�namer0Z	user_passr"r"r#�filenamehs

�z
Link.filenamecCs
t|j�Sr*)r
rr(r"r"r#�	file_pathxszLink.file_pathcCs|jjSr*)r�schemer(r"r"r#r6}szLink.schemecCs|jjS)z4
        This can contain auth information.
        )rr0r(r"r"r#r0�szLink.netloccCst�|jj�Sr*)rr1rr,r(r"r"r#r,�sz	Link.pathcCstt�|j�d���S)Nr+)rr.r/r,r-r(r"r"r#r�sz
Link.splitextcCs|��dS�N�)rr(r"r"r#�ext�szLink.extcCs$|j\}}}}}t�||||df�Sr*)rr�
urlunsplit)rr6r0r,�query�fragmentr"r"r#�url_without_fragment�szLink.url_without_fragmentz[#&]egg=([^&]*)cCs |j�|j�}|sdS|�d�Sr7)�_egg_fragment_re�searchr�group�r�matchr"r"r#�egg_fragment�szLink.egg_fragmentz[#&]subdirectory=([^&]*)cCs |j�|j�}|sdS|�d�Sr7)�_subdirectory_fragment_rer?rr@rAr"r"r#�subdirectory_fragment�szLink.subdirectory_fragmentz2(sha1|sha224|sha384|sha256|sha512|md5)=([a-f0-9]+)cCs |j�|j�}|r|�d�SdS)N���_hash_rer?rr@rAr"r"r#�hash�s
z	Link.hashcCs |j�|j�}|r|�d�SdSr7rGrAr"r"r#�	hash_name�s
zLink.hash_namecCs$t�|j�dd�d�dd�d�S)N�#r8r�?)r.r/r�splitr(r"r"r#�show_url�sz
Link.show_urlcCs
|jdkS)N�file)r6r(r"r"r#�is_file�szLink.is_filecCs|jotj�|j�Sr*)rP�osr,�isdirr5r(r"r"r#�is_existing_dir�szLink.is_existing_dircCs
|jtkSr*)r9rr(r"r"r#�is_wheel�sz
Link.is_wheelcCsddlm}|j|jvS)Nr)�vcs)Zpip._internal.vcsrUr6Zall_schemes)rrUr"r"r#�is_vcs�szLink.is_vcscCs
|jduSr*)rr(r"r"r#�	is_yanked�szLink.is_yankedcCs
|jduSr*)rJr(r"r"r#�has_hash�sz
Link.has_hashcCs@|dus|jsdS|jdus J�|jdus.J�|j|j|jd�S)zG
        Return True if the link has a hash and it is allowed.
        NF)Z
hex_digest)rXrJrI�is_hash_allowed)rZhashesr"r"r#rY�s
zLink.is_hash_allowed)NNNT)$�__name__�
__module__�__qualname__�__doc__�	__slots__rr'r)�propertyrr4r5r6r0r,rr9r=�re�compiler>rCrDrErHrIrJrNrPrSrTrVrWrXrY�
__classcell__r"r"r r#rsj�/











�







r)rQr.r`Zpip._vendor.six.moves.urllibrrZpip._internal.utils.filetypesrZpip._internal.utils.miscrrrZpip._internal.utils.modelsrZpip._internal.utils.typingrZpip._internal.utils.urlsr	r
�typingrrr
rZpip._internal.index.collectorrZpip._internal.utils.hashesrrr"r"r"r#�<module>s