Your IP : 3.21.12.41
�
�Re�
� @ sn d d l Z d d l m Z d d l m Z d d l m Z Gd d � d e � Z d d � Z d d
� Z d S)� N)�Command)�logger)�
pkg_resourcesc sF e Z d Z d Z d Z d Z d Z � f d d � Z d d � Z � S) �ShowCommandz6Show information about one or more installed packages.�showz$
%prog [options] <package> ...z*Show information about installed packages.c s^ t t | � j | | � | j j d d d d d d d d d d
�| j j d | j � d S)Nz-fz--files�dest�files�action�
store_true�defaultF�helpz7Show the full list of installed files for each package.r )�superr �__init__�cmd_opts�
add_option�parser�insert_option_group)�self�args�kw)� __class__� �,/tmp/pip-ztkk0jow-build/pip/commands/show.pyr s zShowCommand.__init__c C s= | s t j d � d S| } t | � } t | | j � d S)Nz.ERROR: Please provide a package name or names.)r �warn�search_packages_info�
print_resultsr )r �optionsr �query�resultsr r r �run s
zShowCommand.run) �__name__�
__module__�__qualname__�__doc__�name�usage�summaryr r r r )r r r s r c c s� t d d � t j D� � } x� | D]� } | j � } | | k r# | | } i | j d 6| j d 6| j d 6d d � | j � D� d 6} t j j
| j | j � d d � } t j j | � r� | | d
<n | Vq# q# Wd S)z�
Gather details from installed distributions. Print distribution name,
version, location, and installed files. Installed files requires a
pip generated 'installed-files.txt' in the distributions '.egg-info'
directory.
c S s% g | ] } | j j � | f � q Sr )�project_name�lower)�.0�pr r r �
<listcomp>, s z(search_packages_info.<locals>.<listcomp>r$ �version�locationc S s g | ] } | j � q Sr )r'