관리-도구
편집 파일: search.cpython-37.pyc
B ��Re| � @ sV d dl mZ d dlZd dlZd dlZd dlmZ d dlmZ d dl m Z d dlm Z d dlmZ d dlmZ d d lmZmZ d d lmZ d dlmZ d dlmZ d d lmZ d dlmZ d dlm Z m!Z! d dl"m#Z# e#�rd dl$m%Z% d dl&m'Z'm(Z(m)Z) d dl*m+Z+ e+de,e,e'e, d��Z-e�.e/�Z0G dd� dee�Z1dd� Z2ddd�Z3dd� Z4dS )� )�absolute_importN)�OrderedDict)� pkg_resources)�parse)� xmlrpc_client)�Command)�SessionCommandMixin)�NO_MATCHES_FOUND�SUCCESS)�CommandError)�PyPI)�PipXmlrpcTransport)�get_terminal_size)� indent_log)�get_distribution�write_output)�MYPY_CHECK_RUNNING)�Values)�List�Dict�Optional)� TypedDict�TransformedHit)�name�summary�versionsc @ s0 e Zd ZdZdZdZdd� Zdd� Zdd � Zd S )� SearchCommandz@Search for PyPI packages whose name or summary contains <query>.z %prog [options] <query>Tc C s. | j jddddtjdd� | j�d| j � d S )Nz-iz--index�index�URLz3Base URL of Python Package Index (default %default))�dest�metavar�default�helpr )�cmd_opts� add_optionr �pypi_url�parser�insert_option_group)�self� r) ��/builddir/build/BUILDROOT/alt-python37-pip-20.2.4-6.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/pip/_internal/commands/search.py�add_options, s zSearchCommand.add_optionsc C sT |st d��|}| �||�}t|�}d }tj�� r<t� d }t||d� |rPtS t S )Nz)Missing required argument (search query).r )�terminal_width) r �search�transform_hits�sys�stdout�isattyr � print_resultsr r )r( �options�args�queryZ pypi_hits�hitsr, r) r) r* �run7 s zSearchCommand.runc C s<