???<!-- GIF89;a -->
123123123123
.....................................................................................................................................???<!-- GIF89;a -->
123123123123
.....................................................................................................................................ó
•abc           @@  s¿   d  d l  m Z d  d l m Z d  d l Z d  d l Z d  d l m Z d  d l m	 Z	 m
 Z
 d  d l m Z d  d l m Z e j e ƒ Z d e f d	 „  ƒ  YZ d
 „  Z e e d „ Z d S(   i    (   t   absolute_import(   t
   FeedParserN(   t   Command(   t   SUCCESSt   ERROR(   t   pkg_resources(   t   canonicalize_namet   ShowCommandc           B@  s2   e  Z d  Z d Z d Z d Z d „  Z d „  Z RS(   s6   Show information about one or more installed packages.t   shows$   
      %prog [options] <package> ...s*   Show information about installed packages.c         O@  s^   t  t |  ƒ j | | Ž  |  j j d d d d d d d t d d	 ƒ|  j j d
 |  j ƒ d  S(   Ns   -fs   --filest   destt   filest   actiont
   store_truet   defaultt   helps7   Show the full list of installed files for each package.i    (   t   superR   t   __init__t   cmd_optst
   add_optiont   Falset   parsert   insert_option_group(   t   selft   argst   kw(    (    s5   /usr/lib/python2.7/site-packages/pip/commands/show.pyR      s    		c         C@  sO   | s t  j d ƒ t S| } t | ƒ } t | d | j d | j ƒsK t St S(   Ns.   ERROR: Please provide a package name or names.t
   list_filest   verbose(   t   loggert   warningR   t   search_packages_infot   print_resultsR
   R   R   (   R   t   optionsR   t   queryt   results(    (    s5   /usr/lib/python2.7/site-packages/pip/commands/show.pyt   run"   s    (   t   __name__t
   __module__t   __doc__t   namet   usaget   summaryR   R"   (    (    (    s5   /usr/lib/python2.7/site-packages/pip/commands/show.pyR      s   	c         c@  sm  i  } x$ t  j D] } | | t | j ƒ <q Wg  |  D] } t | ƒ ^ q4 } xg  | D] } | | k rV | | ^ qV D]ï} i | j d 6| j d 6| j d 6g  | j ƒ  D] } | j ^ qª d 6} d }	 d }
 t | t  j	 ƒ r¢| j
 d ƒ r~| j d ƒ } g  | D] } | j d ƒ d ^ q} g  | D] } t j j | j | ƒ ^ q,} g  | D] } t j j | | j ƒ ^ qW}	 n  | j
 d ƒ r:| j d ƒ }
 q:n˜ | j
 d	 ƒ r| j d	 ƒ } g  | D] } t j j | j | ƒ ^ qÇ} g  | D] } t j j | | j ƒ ^ qò}	 n  | j
 d
 ƒ r:| j d
 ƒ }
 n  | j
 d ƒ re| j d ƒ } | | d <n  | j
 d ƒ r±x: | j d ƒ D]& } | j ƒ  r„| j ƒ  | d <Pq„q„Wn  t ƒ  } | j |
 ƒ | j ƒ  } x! d D] } | j | ƒ | | <qÚWg  } x= |
 j ƒ  D]/ } | j d ƒ r
| j | t d ƒ ƒ q
q
W| | d <|	 r`t |	 ƒ | d <n  | Vqv Wd S(   sî   
    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.
    R&   t   versiont   locationt   requirest   RECORDt   ,i    t   METADATAs   installed-files.txts   PKG-INFOs   entry_points.txtt   entry_pointst	   INSTALLERt	   installers   metadata-versionR(   s	   home-paget   authors   author-emailt   licenses   Classifier: t   classifiersR
   N(   s   metadata-versionR(   s	   home-pageR2   s   author-emailR3   (   R   t   working_setR   t   project_nameR)   R*   R+   t   Nonet
   isinstancet   DistInfoDistributiont   has_metadatat   get_metadata_linest   splitt   ost   patht   joint   relpatht   get_metadatat   egg_infot   stripR   t   feedt   closet   gett
   splitlinest
   startswitht   appendt   lent   sorted(   R    t	   installedt   pR&   t   query_namest   pkgt   distt   dept   packaget	   file_listt   metadatat   linest   lt   pathsR/   t   linet   feed_parsert   pkg_info_dictt   keyR4   (    (    s5   /usr/lib/python2.7/site-packages/pip/commands/show.pyR   /   s`    0


&&+.+.	

c   	      C@  sn  t  } xat |  ƒ D]S\ } } t } | d k rA t j d ƒ n  t j d | j d d ƒ ƒ t j d | j d d ƒ ƒ t j d | j d	 d ƒ ƒ t j d
 | j d d ƒ ƒ t j d | j d d ƒ ƒ t j d | j d d ƒ ƒ t j d | j d d ƒ ƒ t j d | j d d ƒ ƒ t j d d j | j d g  ƒ ƒ ƒ | rt j d | j d d ƒ ƒ t j d | j d d ƒ ƒ t j d ƒ x* | j d g  ƒ D] } t j d | ƒ q¤Wt j d ƒ x3 | j d g  ƒ D] } t j d | j ƒ  ƒ qÞWn  | r t j d  ƒ x0 | j d! g  ƒ D] } t j d | j ƒ  ƒ q'Wd! | k rft j d" ƒ qfq q W| S(#   sD   
    Print the informations from installed distributions found.
    i    s   ---s   Name: %sR&   t    s   Version: %sR)   s   Summary: %sR(   s   Home-page: %ss	   home-pages
   Author: %sR2   s   Author-email: %ss   author-emails   License: %sR3   s   Location: %sR*   s   Requires: %ss   , R+   s   Metadata-Version: %ss   metadata-versions   Installer: %sR1   s   Classifiers:R4   s     %ss   Entry-points:R/   s   Files:R
   s!   Cannot locate installed-files.txt(   R   t	   enumeratet   TrueR   t   infoRF   R?   RC   (	   t   distributionsR   R   t   results_printedt   iRP   t
   classifiert   entryRX   (    (    s5   /usr/lib/python2.7/site-packages/pip/commands/show.pyR   x   s>    %	(   t
   __future__R    t   email.parserR   t   loggingR=   t   pip.basecommandR   t   pip.status_codesR   R   t   pip._vendorR   t   pip._vendor.packaging.utilsR   t	   getLoggerR#   R   R   R   R   R   (    (    (    s5   /usr/lib/python2.7/site-packages/pip/commands/show.pyt   <module>   s   	I