3 ”Re�ã@sšddlZddlZddlZddlZddlmZddlmZddl m Z ddl m Z ddl mZmZddlmZer|ddlmZejeƒZGd d „d eƒZdS) éN)Úcanonicalize_name)Úparse)ÚPyPI)Úhas_tls)Únormalize_pathÚredact_auth_from_url)ÚMYPY_CHECK_RUNNING)ÚListc@s<eZdZdZddgZedd„ƒZdd„Zdd „Zd d „Z d S) Ú SearchScopezF Encapsulates the locations that pip is configured to search. Ú find_linksÚ index_urlscCs†g}x8|D]0}|jdƒr0t|ƒ}tjj|ƒr0|}|j|ƒq Wtƒszx4tj||ƒD]$}t j |ƒ}|j dkrRt j dƒPqRW|||d�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 r )Ú startswithrÚosÚpathÚexistsÚappendrÚ itertoolsÚchainÚ urllib_parseÚurlparseÚschemeÚloggerÚwarning)Úclsr r Úbuilt_find_linksÚlinkÚnew_linkÚparsed©r ú�/builddir/build/BUILDROOT/alt-python36-pip-20.2.4-5.el8.x86_64/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/models/search_scope.pyÚcreates"     zSearchScope.createcCs||_||_dS)N)r r )Úselfr r r r r!Ú__init__FszSearchScope.__init__cCs¬g}g}|jrz|jtjgkrzxF|jD]<}t|ƒ}tj|ƒ}|j rV|j rVtj d|ƒ|j |ƒq$W|j dj dj |ƒƒƒ|j r¢|j dj dj dd„|j Dƒƒƒƒdj |ƒS)Nz:The index url "%s" seems invalid, please provide a scheme.zLooking in indexes: {}z, zLooking in links: {}css|]}t|ƒVqdS)N)r)Ú.0Úurlr r r!ú msz6SearchScope.get_formatted_locations..Ú )r rÚ simple_urlrrÚurlsplitrÚnetlocrrrÚformatÚjoinr )r#ÚlinesÚredacted_index_urlsr&Úredacted_index_urlÚpurlr r r!Úget_formatted_locationsOs$  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,tj|tjtˆƒƒƒ}|jdƒs(|d}|S)Nú/)Ú posixpathr-rÚquoterÚendswith)r&Úloc)Ú project_namer r!Úmkurl_pypi_urlys  z.mkurl_pypi_urlcsg|] }ˆ|ƒ‘qSr r )r%r&)r9r r!ú ‡sz8SearchScope.get_index_urls_locations..)r )r#r8r )r9r8r!Úget_index_urls_locationsqs z$SearchScope.get_index_urls_locationsN) Ú__name__Ú __module__Ú __qualname__Ú__doc__Ú __slots__Ú classmethodr"r$r2r;r r r r!r s  ) "r )rÚloggingrr4Zpip._vendor.packaging.utilsrZpip._vendor.six.moves.urllibrrÚpip._internal.models.indexrÚpip._internal.utils.compatrÚpip._internal.utils.miscrrÚpip._internal.utils.typingrÚtypingr Ú getLoggerr<rÚobjectr r r r r!Ús