VULN_CHECK_I913V6 jddlZddlZddlZddlZddlmZmZmZmZddl m Z ddl m Z ddl mZmZddlmZej$eZee Zee Zee gee fZee gefZGddZd ed efd ZGd d eZGddeZGddeZGddeZ dededededed eeeeeff dZ!y)N)CallableIterableOptionalTuple)InstallationCandidate)Link) path_to_url url_to_path)is_urlc@eZdZedeefdZdefdZde fdZ y) LinkSourcereturnct)z,Returns the underlying link, if there's one.NotImplementedErrorselfs @/usr/lib/python3.12/site-packages/pip/_internal/index/sources.pylinkzLinkSource.links "##ct)z9Candidates found by parsing an archive listing HTML file.rrs rpage_candidateszLinkSource.page_candidates !##rct)z,Links found by specifying archives directly.rrs r file_linkszLinkSource.file_linksrrN) __name__ __module__ __qualname__propertyrrrFoundCandidatesr FoundLinksrrrr r s7 $htn$$$$$J$rr file_urlrc<tj|dddk(S)NF)strictrz text/html) mimetypes guess_type)r#s r _is_html_filer(#s    7 :k IIrcXeZdZdZdededdfdZedee fdZ de fdZ de fd Zy) _FlatDirectorySourcezLink source specified by ``--find-links=``. 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. candidates_from_pagepathrNc||_tjtjj ||_yN)_candidates_from_pagepathlibPathosr,realpath_path)rr+r,s r__init__z_FlatDirectorySource.__init__0s+ &:"\\"''"2"24"89 rcyr.r"rs rrz_FlatDirectorySource.link8src#K|jjD]D}tt|}t |s#|j t |Ed{Fy7wr.)r4iterdirr strr(r/rrr,urls rrz$_FlatDirectorySource.page_candidates<sSJJ&&(Dc$i(C %11$s)< < < ) =sAA'A%A'c#K|jjD]/}tt|}t |r#t |1ywr.)r4r8r r9r(rr:s rrz_FlatDirectorySource.file_linksCs?JJ&&(Dc$i(CS!s)O )sAA)rrr__doc__CandidatesFromPager9r5rrrrr rr!rr"rrr*r*'s_:0::  :htn==Jrr*cXeZdZdZdededdfdZedeefdZ de fdZ de fd Z y) _LocalFileSourceaC``--find-links=`` or ``--[extra-]index-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. r+rrNc ||_||_yr.r/_linkrr+rs rr5z_LocalFileSource.__init__U &:" rc|jSr.rCrs rrz_LocalFileSource.link] zzrc#Kt|jjsy|j|jEd{y7wr.)r(rCr;r/rs rrz _LocalFileSource.page_candidatesas1TZZ^^, --djj999s?A AA c#hKt|jjry|jywr.)r(rCr;rs rrz_LocalFileSource.file_linksfs#  ( jjs02rrrr=r>rr5rrrr rr!rr"rrr@r@Ks_0  htn:: Jrr@c\eZdZdZdedededdfdZede efdZ de fd Z de fd Zy) _RemoteFileSourcez``--find-links=`` or ``--[extra-]index-url=``. This returns: * ``page_candidates``: Links listed on an HTML file. * ``file_candidates``: The non-HTML file. r+page_validatorrrNc.||_||_||_yr.)r/_page_validatorrC)rr+rNrs rr5z_RemoteFileSource.__init__us &:"- rc|jSr.rGrs rrz_RemoteFileSource.linkrHrc#K|j|jsy|j|jEd{y7wr.)rPrCr/rs rrz!_RemoteFileSource.page_candidatess3##DJJ/ --djj999s;AAAc#(K|jywr.rGrs rrz_RemoteFileSource.file_linkssjjs)rrrr=r> PageValidatorrr5rrrr rr!rr"rrrMrMlsi0&   htn:: JrrMcXeZdZdZdededdfdZedeefdZ de fdZ de fd Z y) _IndexDirectorySourcez``--[extra-]index-url=``. This is treated like a remote URL; ``candidates_from_page`` contains logic for this by appending ``index.html`` to the link. r+rrNc ||_||_yr.rBrDs rr5z_IndexDirectorySource.__init__rErc|jSr.rGrs rrz_IndexDirectorySource.linkrHrc#VK|j|jEd{y7wr.rBrs rrz%_IndexDirectorySource.page_candidatess--djj999s )')cy)Nr"r"rs rrz _IndexDirectorySource.file_linkssrrKr"rrrVrVs_ 0  htn::JrrVlocationr+rN expand_dircache_link_parsingcvd}d}tjj|rt|}|}n,|j dr|}t |}n t |r|}|d}tj||y|t||t||}||fStjj|r/|rt||}||fSt|t||}||fStjj|rt|t||}||fStjd||dfS) Nzfile:zVLocation '%s' is ignored: it is either a non-existing path or lacks a specific scheme.)NN)r])r+rNr)r+r,)r+rz?Location '%s' is ignored: it is neither a file nor a directory.)r2r,existsr startswithr r loggerwarningrMrisdirr*rVisfiler@) r[r+rNr\r]r,r;msgsources r build_sourcergsMDC ww~~h(#   W %8$   { K  sH% |.!5)c.@A  V} ww}}T )%9FV} +%9#2DEFV}  !!5c.@A V} NNI ;r)"loggingr&r2r0typingrrrrpip._internal.models.candidaterpip._internal.models.linkrpip._internal.utils.urlsr r pip._internal.vcsr getLoggerrrar r!r>boolrTr r9r(r*r@rMrVrgr"rrrps 66@*=$   8 $01 d^ tfh/D&EEF$&  $ $JCJDJ!:!HzB @J499-9" 9  9  9 8C=(:. ./9r