ޘ^f d dl mZ d dlZd dlZd dlZd dlmZ d dlmZ d dl m Z d dlmZm Z mZmZmZ d dlmZ d dlmZ d d lmZmZ d d lmZ ej e Zee Zee Ze egee f Ze ege f Z! G d d Z"d&dZ# G d d Z$ G d de" Z% G d de" Z& G d de" Z' G d de" Z(d'd%Z)dS )( )annotationsN)defaultdict)Iterable)Callable)InvalidSdistFilenameInvalidWheelFilenamecanonicalize_nameparse_sdist_filenameparse_wheel_filename)InstallationCandidate)Link)path_to_urlurl_to_path)is_urlc 6 e Zd Zed d Zd dZddZdS ) LinkSourcereturnLink | Nonec t )z,Returns the underlying link, if there's one.NotImplementedErrorselfs m/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pip/_internal/index/sources.pylinkzLinkSource.link s "### FoundCandidatesc t )z9Candidates found by parsing an archive listing HTML file.r r s r page_candidateszLinkSource.page_candidates% !###r FoundLinksc t )z,Links found by specifying archives directly.r r s r file_linkszLinkSource.file_links) r r Nr r r r r r! )__name__ __module____qualname__propertyr r r# r r r r sZ $ $ $ X$$ $ $ $$ $ $ $ $ $r r file_urlstrr boolc B t j | d d dk S )NF)strictr z text/html) mimetypes guess_type)r, s r _is_html_filer3 . s" 777:kIIr c R e Zd ZdZd dZddZedd Zedd ZdS )_FlatDirectoryToUrlsz"Scans directory and caches resultspathr- r Nonec b || _ g | _ t t | _ d| _ d S )NF)_path_page_candidatesr list_project_name_to_urls_scanned_directory)r r6 s r __init__z_FlatDirectoryToUrls.__init__5 s/ +-;Ft;L;L""'r c t j | j D ]}t |j }t | r| j | @ t |j d }n=# t $ r0 t |j d }n# t $ r Y Y w xY wY nw xY w| j | | d| _ dS )zrScans directory once and populates both page_candidates and project_name_to_urls at the same time r TN)osscandirr9 r r6 r3 r: appendr namer r r r<