U .e@sddlmZddlZddlZddlZddlmZddlmZddl m Z ddl m Z ddlmZddlmZdd lmZmZdd lmZdd lmZdd lmZdd lmZddlmZddlm Z e!e"Z#GdddeeZ$ddZ%dddZ&ddZ'dS))absolute_importN) OrderedDict) pkg_resources)parse) xmlrpc_client)Command)SessionCommandMixin)NO_MATCHES_FOUNDSUCCESS) CommandError)PyPI)PipXmlrpcTransport)get_terminal_size) indent_log) write_outputcs8eZdZdZdZdZfddZddZdd ZZ S) SearchCommandz@Search for PyPI packages whose name or summary contains .z %prog [options] Tcs@tt|j|||jjddddtjdd|jd|jdS)Nz-iz--indexindexZURLz3Base URL of Python Package Index (default %default))destmetavardefaulthelpr) superr__init__Zcmd_optsZ add_optionr Zpypi_urlparserZinsert_option_group)selfargskw __class__A/usr/lib/python3.8/site-packages/pip/_internal/commands/search.pyr%szSearchCommand.__init__cCsT|s td|}|||}t|}d}tjrksz!print_results..cSsg|] }|jqSr)Z project_name)r?prrr r@psr,r-r5r<   z %-*s - %sz%s (%s)zINSTALLED: %s (latest)z INSTALLED: %sz=LATEST: %s (pre-release; install with "pip install --pre")z LATEST: %s)maxrZ working_setr8r>textwrapZwrapjoinrZget_distributionrr4 parse_versionZpreUnicodeEncodeError) r*Zname_column_widthr!Zinstalled_packagesr;r,r-ZlatestZ target_widthlineZdistrrr r'gsJ          r'cCs t|tdS)N)key)rIrL)r5rrr r8sr8)NN)(Z __future__rZloggingr$rJ collectionsrZ pip._vendorrZpip._vendor.packaging.versionrrLZpip._vendor.six.movesrZpip._internal.cli.base_commandrZpip._internal.cli.req_commandrZpip._internal.cli.status_codesr r Zpip._internal.exceptionsr Zpip._internal.models.indexr Zpip._internal.network.xmlrpcr Zpip._internal.utils.compatrZpip._internal.utils.loggingrZpip._internal.utils.miscrZ getLoggerr/Zloggerrr#r'r8rrrr s*              - )