ó
^\kdc           @   sœ   d  d l  m Z d  d l m Z m Z d  d l m Z d  d l m Z d  d l	 m
 Z
 d  d l m Z m Z d  d l m Z m Z d e f d	 „  ƒ  YZ d
 S(   iÿÿÿÿ(   t   Command(   t   DistributionNotFoundt   BestVersionAlreadyInstalled(   t   PackageFinder(   t   logger(   t   InstallRequirement(   t   get_installed_distributionst   dist_is_editable(   t   make_option_groupt   index_groupt   ListCommandc           B   sz   e  Z d  Z d Z d Z d Z d g Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z RS(   s-   List installed packages, including editables.t   lists   
      %prog [options]s   List installed packages.t   pythonc      	   O   s  t  t |  ƒ j | | �  |  j } | j d d d d d t d d ƒ| j d d	 d d d t d d
 ƒ| j d d d d d t d d ƒ| j d d d d d t d d ƒ| j d d d d t d d ƒt t |  j ƒ } |  j j	 d | ƒ |  j j	 d | ƒ d  S(   Ns   -os
   --outdatedt   actiont
   store_truet   defaultt   helps,   List outdated packages (excluding editables)s   -us
   --uptodates,   List uptodate packages (excluding editables)s   -es
   --editables   List editable projects.s   -ls   --localsS   If in a virtualenv that has global access, do not list globally-installed packages.s   --presY   Include pre-release and development versions. By default, pip only finds stable versions.i    (
   t   superR
   t   __init__t   cmd_optst
   add_optiont   FalseR   R	   t   parsert   insert_option_group(   t   selft   argst   kwR   t
   index_opts(    (    s8   /var/www/testScraper/venv/build/pip/pip/commands/list.pyR      s<    					c         C   sI   t  d | j d | d | j d | j d | j d | j d | j d | ƒ S(	   sK   
        Create a package finder appropriate to this list command.
        t
   find_linkst
   index_urlst   allow_externalt   allow_unverifiedt   allow_all_externalt   allow_all_prereleasest   process_dependency_linkst   session(   R   R   R   R   R    t   preR"   (   R   t   optionsR   R#   (    (    s8   /var/www/testScraper/venv/build/pip/pip/commands/list.pyt   _build_package_finder9   s    					c         C   s\   | j  r |  j | ƒ n? | j r2 |  j | ƒ n& | j rK |  j | ƒ n |  j | ƒ d  S(   N(   t   outdatedt   run_outdatedt   uptodatet   run_uptodatet   editablet   run_editablest   run_listing(   R   R%   R   (    (    s8   /var/www/testScraper/venv/build/pip/pip/commands/list.pyt   runH   s    			c         C   sY   xR |  j  | ƒ D]A \ } } } | | j k r t j d | j | j | f ƒ q q Wd  S(   Ns   %s (Current: %s Latest: %s)(   t   find_packages_latests_versionst   parsed_versionR   t   notifyt   project_namet   version(   R   R%   t   distt   remote_version_rawt   remote_version_parsed(    (    s8   /var/www/testScraper/venv/build/pip/pip/commands/list.pyR(   R   s    c         c   sç  | j  g | j } | j r? t j d d j | ƒ ƒ g  } n  | j r[ t j d d ƒ n  | j r„ t j d d ƒ | | j 7} n  g  } xK t	 d | j
 d |  j ƒ D]. } | j d ƒ r¦ | j | j d ƒ ƒ q¦ q¦ W|  j | ƒ } |  j | | | ƒ } | j | ƒ t	 d | j
 d	 t d |  j ƒ } x¶ | D]® } t j | j d  ƒ } y( | j | t ƒ }	 |	 d  k rsw1n  Wn- t k
 rŠq1nG t k
 r£| j }
 n. X| j |	 | j ƒ d
 }
 |
 d } |
 d
 } | | | f Vq1Wd  S(   Ns   Ignoring indexes: %st   ,s   1.7sˆ   --use-mirrors has been deprecated and will be removed in the future. Explicit uses of --index-url and/or --extra-index-url is suggested.s…   --mirrors has been deprecated and will be removed in  the future. Explicit uses of --index-url and/or --extra-index-url is suggested.t
   local_onlyt   skips   dependency_links.txtt   include_editablesi    i   (   t	   index_urlt   extra_index_urlst   no_indexR   R1   t   joint   use_mirrorst
   deprecatedt   mirrorsR   t   localR9   t   has_metadatat   extendt   get_metadata_linest   _build_sessionR&   t   add_dependency_linksR   R   t	   from_linet   keyt   Nonet   find_requirementt   TrueR   R   t   installed_versiont   _link_package_versionst   name(   R   R%   R   t   dependency_linksR4   R#   t   findert   installed_packagest   reqt   linkt   remote_versionR5   R6   (    (    s8   /var/www/testScraper/venv/build/pip/pip/commands/list.pyR/   X   sD    				
		"!


c         C   s,   t  d | j d |  j ƒ } |  j | ƒ d  S(   NR8   R9   (   R   RB   R9   t   output_package_listing(   R   R%   RR   (    (    s8   /var/www/testScraper/venv/build/pip/pip/commands/list.pyR-   Œ   s    c         C   s)   t  d | j d t ƒ } |  j | ƒ d  S(   NR8   t   editables_only(   R   RB   RL   RV   (   R   R%   RR   (    (    s8   /var/www/testScraper/venv/build/pip/pip/commands/list.pyR,   �   s    c         C   sx   t  | d d „  ƒ} x\ | D]T } t | ƒ rM d | j | j | j f } n d | j | j f } t j | ƒ q Wd  S(   NRI   c         S   s   |  j  j ƒ  S(   N(   R2   t   lower(   R4   (    (    s8   /var/www/testScraper/venv/build/pip/pip/commands/list.pyt   <lambda>•   s    s   %s (%s, %s)s   %s (%s)(   t   sortedR   R2   R3   t   locationR   R1   (   R   RR   R4   t   line(    (    s8   /var/www/testScraper/venv/build/pip/pip/commands/list.pyRV   ”   s    c         C   sY   g  } x? |  j  | ƒ D]. \ } } } | j | k r | j | ƒ q q W|  j | ƒ d  S(   N(   R/   R0   t   appendRV   (   R   R%   R)   R4   R5   R6   (    (    s8   /var/www/testScraper/venv/build/pip/pip/commands/list.pyR*   �   s
    (   t   __name__t
   __module__t   __doc__RO   t   usaget   summaryR9   R   R&   R.   R(   R/   R-   R,   RV   R*   (    (    (    s8   /var/www/testScraper/venv/build/pip/pip/commands/list.pyR
   
   s   		%		
		4				N(   t   pip.basecommandR    t   pip.exceptionsR   R   t	   pip.indexR   t   pip.logR   t   pip.reqR   t   pip.utilR   R   t   pip.cmdoptionsR   R	   R
   (    (    (    s8   /var/www/testScraper/venv/build/pip/pip/commands/list.pyt   <module>   s   