ó
ÇvSc           @   sŽ   d  d l  Z  d  d l Z d  d l Z d  d l m Z d  d l m Z d  d l m Z d  d l	 m
 Z
 d  d l m Z d e f d „  ƒ  YZ d S(	   iÿÿÿÿN(   t   InstallRequirement(   t   logger(   t   Command(   t   get_installed_distributions(   t   pkg_resourcest   FreezeCommandc           B   s;   e  Z d  Z d Z d Z d  Z d „  Z d „  Z d „  Z RS(   s1   Output installed packages in requirements format.t   freezes   
      %prog [options]c         O   sÀ   t  t |  ƒ j | | Ž  |  j j d d d d d d d d  d d	 d
 d ƒ|  j j d d d d d d d g  d d d
 d ƒ|  j j d d d d d d d t d
 d ƒ|  j j d |  j ƒ d  S(   Ns   -rs   --requirementt   destt   requirementt   actiont   storet   defaultt   metavart   filet   helpsV   Use the order in the given requirements file and it's comments when generating output.s   -fs   --find-linkst
   find_linkst   appendt   URLs<   URL for finding packages, which will be added to the output.s   -ls   --localt   localt
   store_truesU   If in a virtualenv that has global access, do not output globally-installed packages.i    (	   t   superR   t   __init__t   cmd_optst
   add_optiont   Nonet   Falset   parsert   insert_option_group(   t   selft   argst   kw(    (    sM   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/pip/commands/freeze.pyR      s,    						c         C   s   t  j ƒ  d  S(   N(   R   t   move_stdout_to_stderr(   R   (    (    sM   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/pip/commands/freeze.pyt   setup_logging-   s    c         C   s£  | j  } | j p g  } | j } t } d  } | j } | rN t j | ƒ } n  g  }	 t j	 }
 x9 t
 j D]. } | j d ƒ rg |	 j | j d ƒ ƒ qg qg Wx* | D]" } d | k r  |	 j | ƒ q  q  Wx | D] } |
 j d | ƒ qÍ Wi  } x? t d | ƒ D]. } t j j | |	 d | ƒ} | | | j <qþ W| rft | ƒ } x| D]	} | j ƒ  sq| j ƒ  j d ƒ r„|
 j | ƒ qIn  | r¬| j | ƒ r¬|
 j | ƒ qIn#| j d ƒ sÊ| j d ƒ r&| j d ƒ rì| d	 j ƒ  } n | t d ƒ j ƒ  j d
 ƒ } t j | d | j ƒ} n© | j d ƒ s­| j d ƒ s­| j d ƒ s­| j d ƒ s­| j d ƒ s­| j d ƒ s­| j d ƒ s­| j d ƒ s­| j d ƒ rÀ|
 j | ƒ qIn t j | ƒ } | j st  j! d | j ƒ  ƒ t  j! d ƒ qIn  | j | k r.t  j" d | j ƒ  ƒ qIn  |
 j t# | | j ƒ ƒ | | j =qIW|
 j d ƒ n  x6 t$ | j% ƒ  d d „  ƒD] } |
 j t# | ƒ ƒ q‚Wd  S(   Ns   dependency_links.txts   #egg=s   -f %s
t
   local_onlyt	   find_tagst   #s   -es
   --editablei   t   =t   default_vcss   -rs   --requirements   -Zs   --always-unzips   -fs   -is   --extra-index-urls   --find-linkss   --index-urls>   Skipping line because it's not clear what it would install: %ss9     (add #egg=PackageName to the URL to avoid this warning)s?   Requirement file contains %s, but that package is not installeds:   ## The following requirements were added by pip --freeze:
t   keyc         S   s   |  j  S(   N(   t   name(   t   x(    (    sM   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/pip/commands/freeze.pyt   <lambda>q   s    (&   R   R   R   R   R   t   skip_requirements_regext   ret   compilet   syst   stdoutR   t   working_sett   has_metadatat   extendt   get_metadata_linesR   t   writeR   t   pipt   FrozenRequirementt	   from_distR'   t   opent   stript
   startswitht   searcht   lent   lstripR    t   from_editableR%   t	   from_lineR   t   notifyt   warnt   strt   sortedt   values(   R   t   optionsR   R   R   R!   R"   t
   skip_matcht
   skip_regext   dependency_linkst   ft   distt   linkt   installationst   reqt   req_ft   linet   line_reqt   installation(    (    sM   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/pip/commands/freeze.pyt   run0   sv    				"			"(	   t   __name__t
   __module__t   __doc__R'   t   usaget   summaryR   R    RQ   (    (    (    sM   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/pip/commands/freeze.pyR      s   		(   R+   R-   R4   t   pip.reqR    t   pip.logR   t   pip.basecommandR   t   pip.utilR   t   pip._vendorR   R   (    (    (    sM   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/pip/commands/freeze.pyt   <module>   s   