1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
U
H=®d.ã@s´ddlZddlZddlZddlmZddlmZddlm    Z    m
Z
m Z ddl m Z ddlmZddlmZmZer ddlmZmZmZmZdd    lmZdd
lmZGd d „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)ÚHashescsPeZdZdZddddddgZd=‡fd
d „    Zd d „Zdd„Zedd„ƒZ    edd„ƒZ
edd„ƒZ edd„ƒZ edd„ƒZ edd„ƒZdd„Zedd„ƒZed d!„ƒZe d"¡Zed#d$„ƒZe d%¡Zed&d'„ƒZe d(¡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_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)ÚkeyÚdefining_class) Ú
startswithr    Ú urllib_parseÚurlsplitrrrrrÚsuperrÚ__init__r)ÚselfÚurlrrrr©Ú    __class__©úPD:\z\workplace\VsCode\pyvenv\venv\Lib\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)rÚrpr#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$r cszLink.urlcCsP|j d¡}t |¡}|s,t|jƒ\}}|St |¡}|sLtdj    ft
ƒŽƒ‚|S)Nú/z&URL {self._url!r} produced no filename) ÚpathÚrstripÚ    posixpathÚbasenamerÚnetlocrÚunquoteÚAssertionErrorr&Úlocals)rr.Únamer2Ú    user_passr#r#r$Úfilenamehs 
 
 ÿz Link.filenamecCs
t|jƒSr,)r
r r*r#r#r$Ú    file_pathxszLink.file_pathcCs|jjSr,)rÚschemer*r#r#r$r:}sz Link.schemecCs|jjS)z4
        This can contain auth information.
        )rr2r*r#r#r$r2‚sz Link.netloccCst |jj¡Sr,)rr3rr.r*r#r#r$r.Šsz    Link.pathcCstt |j d¡¡ƒS)Nr-)rr0r1r.r/r*r#r#r$rsz Link.splitextcCs | ¡dS©Né)rr*r#r#r$Úext“szLink.extcCs$|j\}}}}}t ||||df¡Sr,)rrÚ
urlunsplit)rr:r2r.ÚqueryÚfragmentr#r#r$Úurl_without_fragment˜szLink.url_without_fragmentz[#&]egg=([^&]*)cCs |j |j¡}|sdS| d¡Sr;)Ú_egg_fragment_reÚsearchrÚgroup©rÚmatchr#r#r$Ú egg_fragment szLink.egg_fragmentz[#&]subdirectory=([^&]*)cCs |j |j¡}|sdS| d¡Sr;)Ú_subdirectory_fragment_rerCrrDrEr#r#r$Úsubdirectory_fragmentªszLink.subdirectory_fragmentz2(sha1|sha224|sha384|sha256|sha512|md5)=([a-f0-9]+)cCs |j |j¡}|r| d¡SdS)Né©Ú_hash_rerCrrDrEr#r#r$Úhash¶s
z    Link.hashcCs |j |j¡}|r| d¡SdSr;rKrEr#r#r$Ú    hash_name¾s
zLink.hash_namecCs$t |j dd¡d dd¡d¡S)Nú#r<rú?)r0r1rÚsplitr*r#r#r$Úshow_urlÆsz Link.show_urlcCs
|jdkS)NÚfile)r:r*r#r#r$Úis_fileËsz Link.is_filecCs|jotj |j¡Sr,)rTÚosr.Úisdirr9r*r#r#r$Úis_existing_dirÐszLink.is_existing_dircCs
|jtkSr,)r=rr*r#r#r$Úis_wheelÔsz Link.is_wheelcCsddlm}|j|jkS)Nr)Úvcs)Úpip._internal.vcsrYr:Ú all_schemes)rrYr#r#r$Úis_vcsÙs z Link.is_vcscCs
|jdk    Sr,)rr*r#r#r$Ú    is_yankedàszLink.is_yankedcCs
|jdk    Sr,)rNr*r#r#r$Úhas_hashåsz Link.has_hashcCs@|dks|jsdS|jdk    s t‚|jdk    s.t‚|j|j|jdS)zG
        Return True if the link has a hash and it is allowed.
        NF)Ú
hex_digest)r^rNr4rMÚis_hash_allowed)rÚhashesr#r#r$r`ês
zLink.is_hash_allowed)NNNT)$Ú__name__Ú
__module__Ú __qualname__Ú__doc__Ú    __slots__rr)r+Úpropertyr r8r9r:r2r.rr=rAÚreÚcompilerBrGrHrIrLrMrNrRrTrWrXr\r]r^r`Ú __classcell__r#r#r!r$rsvú ú/ 
 
 
 
 
 
 
 
 
 
 
 
ÿ
 
 
 
 
 
 
 
r)rUr0rhZpip._vendor.six.moves.urllibrrÚpip._internal.utils.filetypesrÚpip._internal.utils.miscrrrÚpip._internal.utils.modelsrÚpip._internal.utils.typingrÚpip._internal.utils.urlsr    r
Útypingr r r rÚpip._internal.index.collectorrÚpip._internal.utils.hashesrrr#r#r#r$Ú<module>s