
    fXf$                         d dl Z d dlZd dlZd dlZd dlZd dlmZ d dlm	Z	 d dl
mZ d dlmZ d dlmZmZ  ej        e          Z G d d          ZdS )	    N)List)canonicalize_name)PyPI)has_tls)normalize_pathredact_auth_from_urlc            	           e Zd ZdZg dZedee         dee         dedd fd            Z	dee         dee         deddfd	Z
defd
Zdedee         fdZdS )SearchScopezF
    Encapsulates the locations that pip is configured to search.
    
find_links
index_urlsno_indexr   r   r   returnc                    g }|D ]\}|                     d          r0t          |          }t          j                            |          r|}|                    |           ]t                      s^t          j        ||          D ]H}t          j
                            |          }|j        dk    rt                              d            nI | |||          S )zQ
        Create a SearchScope object after normalizing the `find_links`.
        ~httpszipip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.r   )
startswithr   ospathexistsappendr   	itertoolschainurllibparseurlparseschemeloggerwarning)clsr   r   r   built_find_linkslinknew_linkparseds           Z/var/www/html/Qu*py/bism/lib/python3.11/site-packages/pip/_internal/models/search_scope.pycreatezSearchScope.create   s    ') 	* 	*Ds## $)$//7>>(++ $#D##D)))) yy 		!
4DEE  ..t44=G++NN%  
 E , s'!
 
 
 	
    Nc                 0    || _         || _        || _        d S Nr   )selfr   r   r   s       r%   __init__zSearchScope.__init__C   s     %$ r'   c                 r   g }g }| j         r| j         t          j        gk    r| j         D ]n}t          |          }t          j                            |          }|j        s"|j        st          
                    d|           |                    |           o|                    d                    d                    |                               | j        rJ|                    d                    d                    d | j        D                                            d                    |          S )Nz:The index url "%s" seems invalid, please provide a scheme.zLooking in indexes: {}z, zLooking in links: {}c              3   4   K   | ]}t          |          V  d S r)   )r   ).0urls     r%   	<genexpr>z6SearchScope.get_formatted_locations.<locals>.<genexpr>l   s+      SSC2377SSSSSSr'   
)r   r   
simple_urlr   r   r   urlsplitr   netlocr   r   r   formatjoinr   )r*   linesredacted_index_urlsr/   redacted_index_urlpurls         r%   get_formatted_locationsz#SearchScope.get_formatted_locationsM   sG    ? 	t4?2CCC ? ?%9#%>%>" |,,-?@@ { 4; NNT*  
 $**+=>>>>LL(//		:M0N0NOO   ? 	LL&--IISS4?SSSSS   
 yyr'   project_namec                 T    dt           dt           ffdfd| j        D             S )zReturns the locations found via self.index_urls

        Checks the url_name on the main (first in the list) index and
        use this url_name to produce all locations
        r/   r   c                     t          j        | t          j                            t                                        }|                    d          s|dz   }|S )N/)	posixpathr6   r   r   quoter   endswith)r/   locr<   s     r%   mkurl_pypi_urlz<SearchScope.get_index_urls_locations.<locals>.mkurl_pypi_urlx   sV    .V\''(9,(G(GHH C <<$$  CiJr'   c                 &    g | ]} |          S  rF   )r.   r/   rD   s     r%   
<listcomp>z8SearchScope.get_index_urls_locations.<locals>.<listcomp>   s#    ???s##???r'   )strr   )r*   r<   rD   s    `@r%   get_index_urls_locationsz$SearchScope.get_index_urls_locationsq   sO    	 	 	 	 	 	 	 	 @???t????r'   )__name__
__module____qualname____doc__	__slots__classmethodr   rH   boolr&   r+   r;   rI   rF   r'   r%   r
   r
      s         988I'
I'
 I'
 	'

 
'
 '
 '
 ['
R!I! I! 	!
 
! ! ! !"  "  "  "  " H@S @T#Y @ @ @ @ @ @r'   r
   )r   loggingr   r@   urllib.parser   typingr   pip._vendor.packaging.utilsr   pip._internal.models.indexr   pip._internal.utils.compatr   pip._internal.utils.miscr   r   	getLoggerrJ   r   r
   rF   r'   r%   <module>rY      s         				               9 9 9 9 9 9 + + + + + + . . . . . . I I I I I I I I		8	$	$t@ t@ t@ t@ t@ t@ t@ t@ t@ t@r'   