Ñò
èRc           @   sd   d  d k  Z  d  d k Z d  d k l Z d  d k l Z d e f d     YZ d   Z d   Z d S(   i˙˙˙˙N(   t   Command(   t   loggert   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 |   i | |   |  i i d d d d d d d t d d	 |  i i d
 |  i  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(    (    sM   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/commands/show.pyR      s    		c         C   s?   | p t  i d  d  S| } t |  } t | | i  d  S(   Ns.   ERROR: Please provide a package name or names.(   R   t   warnt   search_packages_infot   print_resultsR   (   R   t   optionsR   t   queryt   results(    (    sM   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/commands/show.pyt   run   s    (   t   __name__t
   __module__t   __doc__t   namet   usaget   summaryR   R   (    (    (    sM   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/commands/show.pyR      s   	c      	   c   s  t  g  } t i D] } | | i i   | f q ~  } xÏ |  D]Ç } | i   } | | j o¨ | | } h | i d 6| i d 6| i d 6g  } | i   D] } | | i q ~ d 6}	 t i	 i
 | i | i   d d  }
 t i	 i |
  o |
 |	 d <n |	 Vq@ q@ 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   requiress	   .egg-infos   installed-files.txtR   N(   t   dictt   pkg_resourcest   working_sett   project_namet   lowerR!   R"   R#   t   ost   patht   joint   egg_namet   isfile(   R   t   _[1]t   pt   installed_packagesR   t   normalized_namet   distt   _[2]t   dept   packaget   filelist(    (    sM   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/commands/show.pyR   #   s&    6 



.		c         C   sç   xà |  D]Ĝ } t  i d  t  i d | d  t  i d | d  t  i d | d  t  i d d	 i | d
   | oa t  i d  d | j o6 x@ t | d  D] } t  i d | i    qİ Wqß t  i d  q q Wd S(   sD   
    Print the informations from installed distributions found.
    s   ---s   Name: %sR   s   Version: %sR!   s   Location: %sR"   s   Requires: %ss   , R#   s   Files:R   s     %ss!   Cannot locate installed-files.txtN(   R   t   notifyR+   t   opent   strip(   t   distributionst   list_all_filesR2   t   line(    (    sM   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/commands/show.pyR   ?   s      (	   R)   R%   t   pip.basecommandR    t   pip.logR   R   R   R   (    (    (    sM   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/commands/show.pyt   <module>   s   	