관리-도구
편집 파일: search.cpython-36.pyc
3 �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-ej.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� | jjd| 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-python36-pip-20.2.4-5.el8.x86_64/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/commands/search.py�add_options, s zSearchCommand.add_optionsc C sT |st d��|}| j||�}t|�}d }tjj� 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<