관리-도구
편집 파일: search.cpython-38.pyc
U ��.e � @ s� 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 e�!e"�Z#G dd� dee�Z$dd� Z%ddd�Z&dd� Z'dS )� )�absolute_importN)�OrderedDict)� pkg_resources)�parse)� xmlrpc_client)�Command)�SessionCommandMixin)�NO_MATCHES_FOUND�SUCCESS)�CommandError)�PyPI)�PipXmlrpcTransport)�get_terminal_size)� indent_log)�write_outputc s8 e Zd ZdZdZdZ� fdd�Zdd� Zdd � Z� Z S ) � SearchCommandz@Search for PyPI packages whose name or summary contains <query>.z %prog [options] <query>Tc s@ t t| �j||� | jjddddtjdd� | j�d| j� d S )Nz-iz--index�indexZURLz3Base URL of Python Package Index (default %default))�dest�metavar�default�helpr ) �superr �__init__Zcmd_optsZ add_optionr Zpypi_url�parserZinsert_option_group)�self�args�kw�� __class__� �A/usr/lib/python3.8/site-packages/pip/_internal/commands/search.pyr % s �zSearchCommand.__init__c 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 �optionsr �queryZ pypi_hits�hitsr! r r r �run0 s zSearchCommand.runc C s<