ó
û_¾Tc           @   sÓ   d  d l  Z  d  d l Z d  d l Z d  d l Z d  d l m Z m Z d  d l m Z 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 m Z d	 e f d
 „  ƒ  YZ e ƒ  d S(   iÿÿÿÿN(   t   InstallRequirementt   RequirementSet(   t   parse_requirements(   t   logger(   t   build_prefixt
   src_prefix(   t   Command(   t   PackageFinder(   t   InstallationErrort   CommandErrort   InstallCommandc           B   s;   e  Z d  Z d Z d Z e Z d „  Z d „  Z d „  Z	 RS(   t   installs    %prog [OPTIONS] PACKAGE_NAMES...s   Install packagesc         C   s®  t  t |  ƒ j ƒ  |  j j d d d d d d d g  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 g  d d d
 d ƒ|  j j d d d d d d d d d d
 d ƒ|  j j d d d d d d d d g  d
 d ƒ|  j j d d d  d d! d t d
 d" ƒ|  j j d# d$ d d% d d! d t d
 d& ƒ|  j j d' d d( d d d d d g  d
 d) ƒ|  j j d* d+ d, d- d d. d d/ d t d
 d0 ƒ|  j j d1 d2 d d3 d d/ d d  d
 d4 ƒ|  j j d5 d6 d7 d8 d d9 d d/ d d  d
 d: ƒ|  j j d; d d< d d/ d d  d
 d= ƒ|  j j d> d? d@ dA d dB d d/ d t d
 dC ƒ|  j j dD dE d dF d d! d
 dG ƒ|  j j dH d dI d d! d
 dJ ƒ|  j j dK dL d dM d d! d
 dN ƒ|  j j dO dP d dQ d d! d t d
 dR ƒ|  j j dS d dT d d! d
 dU ƒ|  j j dV d dW d d! d
 dX ƒ|  j j dY d dZ d d d
 d[ ƒ|  j j d\ d d] d d d
 d^ ƒ|  j j d_ d d` d d! d
 da ƒd  S(b   Ns   -es
   --editablet   destt	   editablest   actiont   appendt   defaultt   metavars   VCS+REPOS_URL[@REV]#egg=PACKAGEt   helpsM  Install a package directly from a checkout. Source will be checked out into src/PACKAGE (lower-case) and installed in-place (using setup.py develop). You can run this on an existing directory/checkout (like pip install -e src/mycheckout). This option may be provided multiple times. Possible values for VCS are: svn, git, hg and bzr.s   -rs   --requirementt   requirementst   FILENAMEsh   Install all the packages listed in the given requirements file.  This option can be used multiple times.s   -fs   --find-linkst
   find_linkst   URLs   URL to look for packages ats   -is   --index-urls
   --pypi-urlt	   index_urls   http://pypi.python.org/simple/s3   Base URL of Python Package Index (default %default)s   --extra-index-urlt   extra_index_urlss?   Extra URLs of package indexes to use in addition to --index-urls
   --no-indext   no_indext
   store_trues@   Ignore package index (only looking at --find-links URLs instead)s   -Ms   --use-mirrorst   use_mirrorssB   Use the PyPI mirrors as a fallback in case the main index is down.s	   --mirrorst   mirrorss8   Specific mirror URLs to query when --use-mirrors is useds   -bs   --builds   --build-dirs   --build-directoryt	   build_dirt   DIRs@   Unpack packages into DIR (default %default) and build from theres   -ts   --targett
   target_dirs   Install packages into DIR.s   -ds
   --downloads   --download-dirs   --download-directoryt   download_dirs5   Download packages into DIR instead of installing thems   --download-cachet   download_caches    Cache downloaded packages in DIRs   --srcs   --sources   --source-dirs   --source-directoryt   src_dirs9   Check out --editable packages into DIR (default %default)s   -Us	   --upgradet   upgrades4   Upgrade all packages to the newest available versions   --force-reinstallt   force_reinstallsK   When upgrading, reinstall all packages even if they are already up-to-date.s   -Is   --ignore-installedt   ignore_installeds4   Ignore the installed packages (reinstalling instead)s	   --no-depss   --no-dependenciest   ignore_dependenciess   Ignore package dependenciess   --no-installt
   no_installsA   Download and unpack all packages, but don't actually install thems   --no-downloadt   no_downloadsr   Don't download any packages, just install the ones already downloaded (completes an install run with --no-install)s   --install-optiont   install_optionss$  Extra arguments to be supplied to the setup.py install command (use like --install-option="--install-scripts=/usr/local/bin").  Use multiple --install-option options to pass multiple options to setup.py install.  If you are using an option with a directory path, be sure to use absolute path.s   --global-optiont   global_optionssR   Extra global options to be supplied to the setup.pycall before the install commands   --usert   use_user_sites   Install to user-site(	   t   superR
   t   __init__t   parsert
   add_optiont   FalseR   t   NoneR   (   t   self(    (    sl   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/commands/install.pyR-      s   																														c      	   C   s(   t  d | j d | d | j d | j ƒ S(   s¨   
        Create a package finder appropriate to this install command.
        This method is meant to be overridden by subclasses, not
        called directly.
        R   t
   index_urlsR   R   (   R   R   R   R   (   R2   t   optionsR3   (    (    sl   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/commands/install.pyt   _build_package_finder¨   s    	c         C   sÿ  | j  r t | _ t | _ n  t j j | j ƒ | _ t j j | j ƒ | _ | j	 pZ g  } | j
 rv | j d ƒ n  | j rú t | _ t j ƒ  } t j j | j ƒ | _ t j j | j ƒ ræ t j j | j ƒ ræ t d ƒ ‚ n  | j d | ƒ n  | j pg  } | j g | j } | j rHt j d d j | ƒ ƒ g  } n  |  j | | ƒ } t d | j d | j d | j  d	 | j d
 | j d | j d | j d | j ƒ } x' | D] }	 | j t  j! |	 d  ƒ ƒ q²Wx0 | j# D]% }	 | j t  j$ |	 d | j% ƒƒ qßWxA | j& D]6 }
 x- t' |
 d | d | ƒD] } | j | ƒ q1WqW| j( s®i |  j) d 6} | j* r“d t+ | d d j | j* ƒ ƒ} n
 d | } t j, | ƒ d  S| j
 rÕt- j. d" k  rÕt/ d ƒ ‚ n  d d  l0 } | j
 r| j1 rt2 | d t3 ƒ rt/ d ƒ ‚ n  | j4 s@| j5 | d |  j6 d |  j6 ƒn
 | j7 ƒ  | j r³|  j6 r³| j8 | | ƒ d j g  | j9 D] } | j) ^ q~ƒ } | r1t j d | ƒ q1n~ |  j6 sd j g  | j: D] } | j) ^ qÌƒ } | r1t j d | ƒ q1n0 |  j6 r1| j; |  j< ƒ t j d  |  j< ƒ n  | j sD| j  rZ| j= d |  j6 ƒ n  | j rût j j | j ƒ s‹t j> | j ƒ n  t j j | d! ƒ } xH t j? | ƒ D]7 } t@ jA t j j | | ƒ t j j | j | ƒ ƒ q°Wt@ jB | ƒ n  | S(#   Ns   --users=   Target path exists but is not a directory, will not continue.s   --home=s   Ignoring indexes: %st   ,R   R"   R    R!   R#   R%   R&   R$   t   default_vcst   finderR4   t   names^   You must give at least one requirement to %(name)s (maybe you meant "pip %(name)s %(links)s"?)t   linkst    sL   You must give at least one requirement to %(name)s (see "pip help %(name)s")i   i   s8   --user is only supported in Python version 2.6 and neweriÿÿÿÿt   _distributes?   --user --editable not supported with setuptools, use distributet   force_root_egg_infot   bundles   Successfully installed %ss   Successfully downloaded %ss   Created bundle in %ss   lib/python/(   i   i   (C   R    t   TrueR'   R%   t   ost   patht   abspathR   R"   R)   R+   R   R   t   tempfilet   mkdtempt   existst   isdirR	   R*   R   R   R   R   t   notifyt   joinR5   R   R!   R#   R&   R$   t   add_requirementR    t	   from_lineR1   R   t   from_editableR7   R   R   t   has_requirementsR9   R   t   dictt   warnt   syst   version_infoR   t
   setuptoolst   has_editablest   getattrR0   R(   t   prepare_filesR>   t   locate_filesR   t   successfully_installedt   successfully_downloadedt   create_bundlet   bundle_filenamet   cleanup_filest   makedirst   listdirt   shutilt   movet   rmtree(   R2   R4   t   argsR)   t   temp_target_dirR*   R3   R8   t   requirement_setR9   t   filenamet   reqt   optst   msgRQ   t	   installedt
   downloadedt   lib_dirt   item(    (    sl   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/commands/install.pyt   run³   sª    					+											"				"
					(
   t   __name__t
   __module__R9   t   usaget   summaryR0   R>   R-   R5   Rk   (    (    (    sl   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/commands/install.pyR
      s   	”	(   R@   RO   RC   R]   t   pip.reqR    R   R   t   pip.logR   t   pip.locationsR   R   t   pip.basecommandR   t	   pip.indexR   t   pip.exceptionsR   R	   R
   (    (    (    sl   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/commands/install.pyt   <module>   s   ÿ 
