U ÀÒ.eƒã@sšddlZddlZddlZddlZddlmZddlmZddl m Z ddl m Z ddl mZmZddlmZer|ddlmZe e¡ZGd d „d eƒZdS) éN)Úcanonicalize_name)Úparse)ÚPyPI)ÚHAS_TLS)Únormalize_pathÚredact_auth_from_url)ÚMYPY_CHECK_RUNNING)ÚListc@s4eZdZdZedd„ƒZdd„Zdd„Zdd „Zd S) Ú SearchScopezF Encapsulates the locations that pip is configured to search. cCs~g}|D]0}| d¡r.t|ƒ}tj |¡r.|}| |¡qtsrt ||¡D]&}t   |¡}|j dkrJt   d¡qrqJ|||d�S)zQ Create a SearchScope object after normalizing the `find_links`. ú~Zhttpszipip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.©Ú find_linksÚ index_urls)Ú startswithrÚosÚpathÚexistsÚappendrÚ itertoolsÚchainÚ urllib_parseZurlparseZschemeÚloggerZwarning)Úclsr rZbuilt_find_linksÚlinkZnew_linkZparsed©rúE/usr/lib/python3.8/site-packages/pip/_internal/models/search_scope.pyÚcreates&     ÿþzSearchScope.createcCs||_||_dS©Nr )Úselfr rrrrÚ__init__GszSearchScope.__init__cCslg}|jr:|jtjgkr:| d d dd„|jDƒ¡¡¡|jrb| d d dd„|jDƒ¡¡¡d |¡S)NzLooking in indexes: {}z, css|]}t|ƒVqdSr©r©Ú.0ÚurlrrrÚ Usz6SearchScope.get_formatted_locations..zLooking in links: {}css|]}t|ƒVqdSrr r!rrrr$ZsÚ )rrZ simple_urlrÚformatÚjoinr )rÚlinesrrrÚget_formatted_locationsPsÿÿÿÿz#SearchScope.get_formatted_locationscs ‡fdd„‰‡fdd„|jDƒS)z²Returns 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 cs,t |t tˆƒ¡¡}| d¡s(|d}|S)Nú/)Ú posixpathr'rZquoterÚendswith)r#Zloc)Ú project_namerrÚmkurl_pypi_urlgs þ z.mkurl_pypi_urlcsg|] }ˆ|ƒ‘qSrrr!)r.rrÚ tsz8SearchScope.get_index_urls_locations..)r)rr-r)r.r-rÚget_index_urls_locations_s z$SearchScope.get_index_urls_locationsN) Ú__name__Ú __module__Ú __qualname__Ú__doc__Ú classmethodrrr)r0rrrrr s  ( r )rZloggingrr+Zpip._vendor.packaging.utilsrZpip._vendor.six.moves.urllibrrZpip._internal.models.indexrZpip._internal.utils.compatrZpip._internal.utils.miscrrZpip._internal.utils.typingrÚtypingr Z getLoggerr1rÚobjectr rrrrÚs