
eMc        0   @   sw  d  d k  Z  d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d  d k	 Z	 d  d k
 Z
 d  d k Z d  d k Z d  d k Z d  d k Z y d  d k l Z Wn( e j
 o d  d k Z e i Z n Xd  d k Z d  d k l Z d  d k Z d  d k l Z d  d k Z d  d k l Z d  d k l Z d  d k Z d  d k Z d  d k  Z  d  d k! Z! d  d k" Z" d e# f d     YZ$ d	 e$ f d
     YZ% e& e  d e'  o4 e i( i) e  i* d  Z+ e i( i) e  i* d  Z, n7 e i( i) e i-   d  Z+ e i( i) e i-   d  Z, d Z. d Z/ e  i0 d j o
 d Z1 n d Z1 e' Z2 e i3 i4 d  o e i3 d Z2 n y0 e i5 d  Z6 d e6 e6 i7 e  i8 d  f Z8 Wn e i% j
 o e' Z8 n Xd e9 f d     YZ: e:   Z; e i< d d d e8 d e=  Z> e> i? d d d d  d! d" d  d# e> i? d$ d% d d& d' d( d  d) e> i? d* d+ d d, d! d- d. d/ d  d0 e> i? d1 d2 d d3 d! d- d. d/ d  d4 e> i? d5 d d6 d' d7 d  d8 e> i? d9 d d: d; d< d. d= d  d> e> i? d? d' d@ d dA d; dB d. e/ d  dC e/ e> i@   h  ZA dD e9 f dE     YZB dF eB f dG     YZC eC   dH eB f dI     YZD eD   dJ eD f dK     YZE eE   dL eB f dM     YZF eF   dN eB f dO     YZG eG   dP eG f dQ     YZH eH   e' dR  ZI d= dS  ZJ d= dT  ZK e' dU  ZL dV   ZM dW e9 f dX     YZN dY e9 f dZ     YZO d[ ZP d\ e9 f d]     YZQ d^ e9 f d_     YZR d` e9 f da     YZS db e9 f dc     YZT dd e9 f de     YZU df e9 f dg     YZV e iW dh  ZX e iW di  ZY e iW dj  ZZ e iW dk  Z[ dl eV f dm     YZ\ e; i] e\  dn eV f do     YZ^ e; i] e^  dp eV f dq     YZ_ e; i] e_  dr eV f ds     YZ` e; i] e`  dt   Za e iW du e ib  Zc e iW dv e ib  Zd e' dw  Ze e' dx  Zf dy e9 f dz     YZg eh e' e' eh eg ii e' e' d{  Zj d|   Zk d}   Zl d~   Zm d   Zn d   Zo e iW d e ib  Zp d   Zq d   Zr d   Zs d   Zt d d  Zu d   Zv d   Zw d   Zx d   Zy e iW d e ib  Zd e iW d e ib  Zz d   Z{ d   Z| d   Z} d   Z~ d   Z d e9 f d     YZ e   Z [ e d j o% eI   Z e o e  i e  n n d S(   iN(   t   md5(   t
   FeedParser(   t   StringIO(   t   Queue(   t   Emptyt   InstallationErrorc           B   s   e  Z d  Z RS(   s%   General exception during installation(   t   __name__t
   __module__t   __doc__(    (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR   #   s   t   DistributionNotFoundc           B   s   e  Z d  Z RS(   sC   Raised when a distribution cannot be found to satisfy a requirement(   R   R   R   (    (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR	   &   s   t   real_prefixt   buildt   srcs   http://pypi.python.org/simplei   t   win32s   git.cmdt   gitt   PIP_DEFAULT_VCSt   pips   %s from %s (python %s)i   t
   VcsSupportc           B   s   e  Z h  Z d  d d d d g Z d   Z d   Z e d    Z e d    Z d	   Z	 d d d
  Z d   Z d   Z d   Z RS(   t   sshR   t   hgt   bzrt   sftpc         C   s=   t  i i |  i  t  i i |  i  t t |   i   d  S(   N(   t   urlparset   uses_netloct   extendt   schemest   uses_fragmentt   superR   t   __init__(   t   self(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR   P   s    c         C   s   |  i  i   S(   N(   t	   _registryt   __iter__(   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR   U   s    c         C   s   |  i  i   S(   N(   R   t   values(   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   backendsX   s    c         C   s%   g  } |  i  D] } | | i q ~ S(   N(   R!   t   dirname(   R   t   _[1]t   backend(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   dirnames\   s    c         C   sT   t  | d  p t i d | i  d  S| i |  i j o | |  i | i <n d  S(   Nt   names   Cannot register VCS %s(   t   hasattrt   loggert   warnR   R&   R   (   R   t   cls(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   register`   s
    c         C   sV   | |  i  j o |  i  | =n5 | |  i  i   j o |  i  | i =n t i d  d  S(   Ns0   Cannot unregister because no class or name given(   R   R    R&   R(   R)   (   R   R*   R&   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt
   unregisterg   s
    c         C   sI   xB |  i  D]7 } t i i | d |  } t i i |  o | Sq
 Wd S(   s   
        Return the name of the version control backend if found at given
        location, e.g. vcs.get_backend_name('/path/to/vcs/checkout')
        s   .%sN(   R   t   ost   patht   joint   existst   None(   R   t   locationt   vc_typeR.   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   get_backend_nameo   s    
 	c         C   s    | |  i  j o |  i  | Sd  S(   N(   R   (   R   R&   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   get_backendz   s    c         C   s(   |  i  |  } | o |  i |  Sd  S(   N(   R4   R5   R1   (   R   R2   R3   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   get_backend_from_location~   s    N(   R   R   R   R   R   R   t   propertyR!   R%   R+   R1   R,   R4   R5   R6   (    (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR   K   s   					t   usages   %prog COMMAND [OPTIONS]t   versiont   add_help_options   -hs   --helpt   destt   helpt   actiont
   store_trues	   Show helps   -Es   --environmentt   venvt   metavart   DIRsd   virtualenv environment to run pip in (either give the interpreter or the environment base directory)s   -vs	   --verboset   verboset   countt   defaulti    s   Give more outputs   -qs   --quiett   quiets   Give less outputs   --logt   logt   FILENAMEsA   Log file where a complete (maximum verbosity) record will be kepts   --proxyt   proxyt   typet   strt    s   Specify a proxy in the form user:passwd@proxy.server:port. Note that the user:password@ is optional and required only if you are behind an authenticated proxy.  If you provide user@proxy.server:port then you will be prompted for a password.s	   --timeoutt   SECONDSt   timeoutt   floats+   Set the socket timeout (default %s seconds)t   Commandc           B   s/   e  Z d Z d Z d    Z d   Z d   Z RS(   c         C   s   |  i  p t  t i d |  i d d t i d |  i  f d t i  |  _ xC t i	 D]8 } | i
 p | i
 d j o qV n |  i i |  qV W|  t |  i  <d  S(   NR8   t   progs   %s %si    R9   R<   (   R&   t   AssertionErrort   optparset   OptionParserR8   t   syst   argvt   parserR9   t   option_listR;   t
   add_optiont	   _commands(   R   t   option(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR      s    		
 c         C   sk   x@ d d d g D]/ } t  | | t | |  p t | |   q W| i | i 7_ | i | i 7_ d  S(   NRF   R?   RH   (   t   setattrt   getattrRE   RB   (   R   t   initial_optionst   optionst   attr(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   merge_options   s
     -c         C   sr  |  i  i |  \ } } |  i | |  | o2 | d d j o! | d } | d  } d  | _ n d } | | i 7} | | i 8} t i d |  } g  } t | t	 i
 f t i | i f g  a t i i d  o t t _ n | i o5 | i d j o d | i GHn t | i |  d  S| i o, t | i  } t i i t i | f  n d  } t i | i p d   t | i  d }	 y |  i | |  Wnb t j
 o6 }
 t i t |
   t i  d	 t!    d }	 n" t i d
 t!    d }	 n X| d  j	 o | i"   n |	 oM d } d i# |  } t i d |  t |  } | i$ |  | i"   n |	 S(   Nit   ___VENV_RESTART___ii   i   t   PIP_LOG_EXPLICIT_LEVELSi    s   Running in environment %ss   Exception information:
%ss   Exception:
%si   s   ./pip-log.txts   
s   Storing complete log in %s(%   RV   t
   parse_argsR`   R1   R?   RB   RE   t   Loggert   level_for_integerRT   t   stdoutt   DEBUGt   appendR(   R-   t   environt   gett   Truet   explicit_levelst   restart_in_venvRF   t   open_logfile_appendt	   consumerst   sockett   setdefaulttimeoutRM   t   setup_proxy_handlerRH   t   runR   t   fatalRJ   t   infot
   format_exct   closeR/   t   write(   R   t   complete_argst   argsR]   R^   t   venv_locationt   levelt   complete_logt   log_fpt   exitt   et   log_fnt   text(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   main   s\    





N(   R   R   R1   R&   R8   R   R`   R   (    (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRO      s
   		t   HelpCommandc           B   s#   e  Z d  Z d Z d Z d   Z RS(   R<   s   %progs   Show available commandsc         C   s   | oG | d } | t  j o t d |   n t  | } | i i   d  St i   Hd GHt t t  i     } | i d d    x# | D] } d | i | i	 f GHq Wd  S(   Ni    s   No command with the name: %ss   Commands available:t   keyc         S   s   |  i  S(    (   R&   (   t   x(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   <lambda>"  s    s     %s: %s(
   RY   R   RV   t
   print_helpt   listt   setR    t   sortR&   t   summary(   R   R^   Rz   t   commandt   commands(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRs     s    


 (   R   R   R&   R8   R   Rs   (    (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s   t   InstallCommandc           B   s2   e  Z d  Z d Z d Z e Z d   Z d   Z RS(   t   installs    %prog [OPTIONS] PACKAGE_NAMES...s   Install packagesc         C   s  t  t |   i   |  i i d d d d d d d g  d d	 d
 d |  i i d d d d d d d g  d d d
 d |  i i d d d d d d d g  d d d
 d |  i i d d d d d d d t d
 d |  i i d d d d d d d d g  d
 d |  i i d d d d  d d! d d" d d  d
 d# t |  i i d$ d% d d& d d" d d  d
 d' t |  i i d( d) d d* d d+ d
 d, |  i i d- d. d d/ d d+ d
 d0 |  i i d1 d d2 d d+ d
 d3 |  i i d4 d d5 d d d
 d6 d  S(7   Ns   -es
   --editableR;   t	   editablesR=   Rh   RD   R@   s   VCS+REPOS_URL[@REV]#egg=PACKAGER<   sM  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   requirementsRG   sh   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-urlt	   index_urls    base URL of Python Package Indexs   --extra-index-urlt   extra_index_urlss?   extra URLs of package indexes to use in addition to --index-urls   -bs   --builds   --build-dirs   --build-directoryt	   build_dirRA   s:   Unpack packages into DIR (default %s) and build from theres   --srcs   --sourcet   src_dirs3   Check out --editable packages into DIR (default %s)s   -Us	   --upgradet   upgradeR>   s4   Upgrade all packages to the newest available versions   -Is   --ignore-installedt   ignore_installeds4   Ignore the installed packages (reinstalling instead)s   --no-installt
   no_installsA   Download and unpack all packages, but don't actually install thems   --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(	   R   R   R   RV   RX   t   pypi_urlR1   t   base_prefixt   base_src_prefix(   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR   .  s    																		c   
   
   C   s  | i  p t | _  n | i p t | _ n t i i | i   | _  t i i | i  | _ | i p g  } | i g | i	 } t
 d | i d |  } t d | i  d | i d | i d | i  } x' | D] } | i t i | d    q Wx' | i D] } | i t i |   q Wx; | i D]0 } x' t | d | D] }	 | i |	  q=Wq$W| i | d |  i | i o- |  i o" | i |  t i d	 |  n  |  i p t i d
 |  n | S(   NR   t
   index_urlsR   R   R   R   t   findert   force_root_egg_infos   Successfully installed %ss   Successfully downloaded %s(   R   R   R   R   R-   R.   t   abspathR   R   R   t   PackageFinderR   t   RequirementSetR   R   t   add_requirementt   InstallRequirementt	   from_lineR1   R   t   from_editableR   t   parse_requirementst   install_filest   bundleR   R   R(   t   notify(
   R   R^   Rz   R   R   R   t   requirement_setR&   t   filenamet   req(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRs   ~  sH    

					 
 
  
(	   R   R   R&   R8   R   t   FalseR   R   Rs   (    (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR   (  s   	Pt   BundleCommandc           B   s2   e  Z d  Z d Z d Z e Z d   Z d   Z RS(   R   s5   %prog [OPTIONS] BUNDLE_NAME.pybundle PACKAGE_NAMES...s8   Create pybundles (archives containing multiple packages)c         C   s   t  t |   i   d  S(   N(   R   R   R   (   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s    c         C   s   | p t  d   n | i p t t d  | _ n | i p t t d  | _ n t | _ t i	 d t
 | i  t
 | i  f  | d } | d } t t |   i | |  } | i |  t i	 d |  | S(   Ns   You must give a bundle filenames   -bundlesB   Putting temporary build files in %s and source/develop files in %si    i   s   Created bundle in %s(   R   R   t
   backup_dirR   R   R   Rk   R   R(   R   t   display_pathR   R   Rs   t   create_bundle(   R   R^   Rz   t   bundle_filenameR   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRs     s    

		 

(	   R   R   R&   R8   R   Rk   R   R   Rs   (    (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s   	t   FreezeCommandc           B   s,   e  Z d  Z d Z d Z d   Z d   Z RS(   t   freezes   %prog [OPTIONS] FREEZE_NAME.txtsN   Put all currently installed packages (exact versions) into a requirements filec         C   sy   t  t |   i   |  i i d d d d d d d d  d d	 d
 d |  i i d d d d d d d g  d d d
 d d  S(   Ns   -rs   --requirementR;   t   requirementR=   t   storeRD   R@   RG   R<   s[   Use the given requirements file as a hint about how to generate the new frozen requirementss   -fs   --find-linksR   Rh   R   sM   URL for finding packages, which will be added to the frozen requirements file(   R   R   R   RV   RX   R1   (   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s    				c         C   s  | o | d } n d } | i  } | i p g  } t } | d j o t i   n g  } | d j o t i } n! t i d |  t | d  } x; t	 i
 D]0 }	 |	 i d  o | i |	 i d   q q Wx, | D]$ }
 d |
 j o | i |
  q q Wx | D] }
 | i d |
  q	Wh  } xM t	 i
 D]B }	 |	 i d j o q4n t i |	 | d | } | | | i <q4W| ot |  } x| D]} | i   p | i   i d  o | i |  qn | i d  p | i d  oV | i d  o | d i   } n  | t d  i   i d  } t i |  } nn | i d  p0 | i d  p  | i d  p | i d  o t i d | i    qn t i |  } | i p t i d | i    qn | i | j o t i d | i    qn | i t | | i   | | i =qW| i d  n x6 t | i   d d   D] } | i t |   q`W| d j o t i d |  | i    n d  S(   Ni    t   -s!   Writing frozen requirements to %st   ws   dependency_links.txts   #egg=s   -f %s
t
   setuptoolsR   t   pythont	   find_tagst   #s   -es
   --editablei   t   =s   -rs   --requirements   -Zs   --always-unzips   Skipping line %rs>   Skipping line because it's not clear what it would install: %ss?   Requirement file contains %s, but that package is not installeds:   ## The following requirements were added by pip --freeze:
R   c         S   s   |  i  S(    (   R&   (   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s    s   Put requirements in %s(   R   R   s   python(!   R   R   R   R(   t   move_stdout_to_stderrRT   Rf   R   t   opent   pkg_resourcest   working_sett   has_metadataR   t   get_metadata_linesRh   Rx   R   t   FrozenRequirementt	   from_distR&   t   stript
   startswitht   lent   lstripR   R   t   debugR   R)   RJ   t   sortedR    Rw   (   R   R^   Rz   R   R   R   R   t   dependency_linkst   ft   distt   linkt   installationsR   t   req_ft   linet   line_reqt   installation(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRs     s    	
   
  $   
		 (   R   R   R&   R8   R   R   Rs   (    (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s
   	t
   ZipCommandc           B   s}   e  Z d  Z d Z d Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z d
   Z d   Z d   Z d   Z RS(   t   zips    %prog [OPTIONS] PACKAGE_NAMES...s   Zip individual packagesc      
   C   s  t  t |   i   |  i d j o& |  i i d d d d d d d n) |  i i d	 d d
 d d d t d d |  i i d d d d d d d |  i i d d d d d d d d |  i i d d d d d d d |  i i d d d d d d d |  i i d d d d d d d  S(   NR   s   --unzipR=   R>   R;   t   unzipR<   s!   Unzip (rather than zip) a packages   --zipt   store_falseRD   s!   Zip (rather than unzip) a packages   --no-pyct   no_pycsD   Do not include .pyc files in zip files (useful on Google App Engine)s   -ls   --listR   s1   List the packages available, and their zip statuss   --sort-filest
   sort_filessC   With --list, sort packages according to how many files they contains   --pathRh   t   pathss>   Restrict operations to the given paths (may include wildcards)s   -ns
   --simulates/   Do not actually perform the zip/unzip operation(   R   R   R   R&   RV   RX   Rk   (   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR   "  sJ    									c         C   s{  |  i  p t i Sg  } t   } xt i D] } t i i t i i |   } x |  i  D] } t i i t i i |   } d | j oC t i t	 i
 | d  |  o | i |  | i |  Pq qY | i |  o | i |  | i |  PqY qY Wt i d | d i |  i   f  q+ WxM |  i  D]B } | | j o/ d | j o" | i |  t i d |  q1q1W| S(   s:   All the entries of sys.path, possibly restricted by --patht   *s,   Skipping path %s because it doesn't match %ss   , sD   Adding path %s because it doesn't match anything already on sys.path(   t   select_pathsRT   R.   R   R-   t   normcaseR   t   ret   searcht   fnmatcht	   translateRh   t   addR   R(   R   R/   (   R   t   resultt	   match_anyR.   t   match(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR   J  s8    
	
 
  			
 	c         C   sE  | i  |  _ | i |  _ | i o |  i | |  S| p t d   n g  } x | D] } |  i |  \ } } | i o- t i i	 |  o t d | | f   n: | i o. t i i	 |  o t d | | f   n | i
 | | f  qW WxE | D]= \ } } | i o |  i | |  S|  i | | | i  Sq Wd  S(   Ns2   You must give at least one package to zip or unzips;   The module %s (in %s) is not a zip file; cannot be unzippeds:   The module %s (in %s) is not a directory; cannot be zipped(   R   R   t   simulateR   R   t   find_packageR   R-   R.   t   isdirRh   t   unzip_packaget   zip_packageR   (   R   R^   Rz   t   packagest   argt   module_nameR   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRs   h  s2    
  
c         C   s  t  i i |  } t  i i |  o- t i |  o t d | | | f   n t  i i |  } | |  i   j o0 t i	 d t
 |  t
 |  t
 |  f  n t i d | t
 |  f  |  i o t i d  d  St i d 7_ zt i |  } g  } x| i   D] } | i d |  o | i |  } t  i i | |  }	 t  i i t  i i |	   p t  i t  i i |	   n | o8 |	 i d  o( t  i i |	  p t  i |	  qqt |	 d  }
 |
 i |  |
 i   q| i | | i |  f  qW| i   | p5 t i d	 t
 |   t  i |  |  i |  na t i d
 | t
 |  f  t i | d  } x$ | D] \ } } | i | |  qW| i   Wd  t i d 8_ Xd  S(   Ns3   Module %s (in %s) isn't located in a zip file in %ss/   Unpacking %s into %s, but %s is not on sys.paths   Unzipping %s (in %s)s3   Skipping remaining operations because of --simulatei   s   %s/t   /t   wbs   Removing now-empty zip file %ss(   Removing entries in %s/ from zip file %sR   (   R-   R.   R"   t   isfilet   zipfilet
   is_zipfileR   R   R(   R)   R   R   R   t   indentt   ZipFilet   namelistR   t   readR/   R0   t   makedirst   endswithR   Rx   Rw   Rh   Ru   t   unlinkt   remove_filename_from_ptht   writestr(   R   R   R   t   zip_filenamet   package_pathR   t   to_saveR&   t   contentR;   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     sZ    $
  
 c         C   s  | } t  i d | t |  f  t  i d 7_ | i d  o
 | } n | d } z| | j oE t |  } t  i d | | f  |  i p t i | |  q n yt  i	 d t |   |  i pLt
 i | d  } | i | d d	  xt i |  D]\ } } }	 | o? g  }
 |	 D]' } | i   i d
  p |
 | q&q&~
 }	 n x | t f |	 t f g D] \ } } x | D]{ } t i i | |  } t i i | | t |  i t i i  |  } | o | i | d d	  q| i | |  qWqsWqW| i   n t  i	 d t |   |  i p t i |  n Wn
   n X|  i |  Wd  t  i d 8_ Xd  S(   Ns   Zip %s (in %s)i   s   .eggs   .zips   Moving %s aside to %ss   Creating zip file in %sR   R   RK   s   .pycs   Removing old directory %s(   R(   R   R   R   R   R   R   t   shutilt   moveRu   R   R   R   R-   t   walkt   lowerRk   R   R.   R/   R   R   t   sepRx   Rw   t   rmtreet   add_filename_to_pth(   R   R   R   R   t   orig_filenamet   dest_filenameR   t   dirpathR%   t	   filenamesR#   R   t   fnst   is_dirt   fnt   fullR;   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     sN    



 .  1
c         C   s>  x |  i    D]} t | d  } | i   } | i   g  } | D]$ } | i   | j o | | qC qC ~ } | | j o t i d t |  t |  f  t d  |  p6 t i d t |   |  i
 p t i |  qn5 |  i
 p* t | d  } | i |  | i   n d  Sq Wt i d t |   d  S(   Nt   rs*   Removing reference to %s from .pth file %ss    %s file would be empty: deletingR   s.   Cannot find a reference to %s in any .pth file(   t	   pth_filesR   t	   readlinesRw   R   R(   Ru   R   t   filterR1   R   R-   R   t
   writelinesR)   (   R   R   t   pthR   t   linesR#   t   lt	   new_lines(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s&     
8	

	c         C   s  t  i i |  } t  i i | | d  } | |  i   j o t i d t |   n |  i p t  i i	 |  og t
 |  } | i   } | i   | o) | d i d  o | d c d 7<n | i | d  n | d g } t
 | d  } | i |  | i   n d  S(   Ns   .pths.   Adding .pth file %s, but it is not on sys.pathis   
R   (   R-   R.   R"   R/   R   R(   R)   R   R   R0   R   R  Rw   R   Rh   R  (   R   R   R.   R;   R   R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s     

c         c   s   x |  i    D]w } t i i |  p t i i |  o q n x? t i |  D]. } | i d  o t i i | |  VqR qR Wq Wd  S(   Ns   .pth(   R   R-   R.   R0   R   t   listdirR   R/   (   R   R.   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  	  s     ( c         C   s   x |  i    D] } t i i | |  } t i i |  o | | f St i i |  oo t i |  o_ t i | d  } y | i	 d |  Wn t
 j
 o n X| i   | | f S| i   q q Wt d |   d  S(   NR  s   %s/__init__.pys!   No package with the name %s found(   R   R-   R.   R/   R0   R   R   R   R   R   t   KeyErrorRw   R   (   R   t   packageR.   R  R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s      $

c         C   s\  | o t  d   n x>t |  i    D]*} t i i |  p q* n t i i | i t i i   } t i i	 |  oQ t
 i |  oA t i i |  |  i   j o t i d t |   q* q* n | d j o1 | d j o$ | i d d  i d  o q* n t i d t |   t i d	 7_ g  } g  } zx t t i |   D] } t i i |  d
 i   } | d j o qXn | d j o t i d t |   qXn t i i | |  }	 t i i |	  o  | i | |  i |	  f  qXt
 i |	  o | i |  qXt i d t |   qXW| oU t i d  t i d	 7_ z" x | D] } t i |  qjWWd  t i d	 8_ Xn t i d  | o | i o | i d d    n t i d  t i d	 7_ z2 x+ | D]# \ } }
 t i d | |
 f  qWWd  t i d	 8_ Xn t i d  Wd  t i d	 8_ Xq* Wd  S(   Ns'   You cannot give an argument with --lists   Zipped egg: %ss   site-packagess   dist-packagess   \R   s
   lib/pythons   In %s:i   i   s   .pths	   .egg-infos	   .egg-links   .pys    Not displaying %s: not a packages   Unknown file: %ss   Zipped packages:s   No zipped packages.R   c         S   s	   |  d  S(   i   (    (   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR   R  s    s   Unzipped packages:s   %s  (%i files)s   No unzipped packages.(   s   .pths	   .egg-infos	   .egg-link(   R   R   R   R-   R.   R0   t   basenamet   rstripR	  R   R   R   R"   R(   R   R   t   replaceR   R   R  t   splitextR  Ru   R/   R   Rh   t   count_packageR   R   (   R   R^   Rz   R.   R   t   zippedt   unzippedR   t   extR  RC   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR   $  sn     !#   
 c         C   sx   d } xk t  i |  D]Z \ } } } g  } | D]' } | i   i d  p | | q0 q0 ~ } | t |  7} q W| S(   Ni    s   .pyc(   R-   R  R  R   R   (   R   R.   t   totalR  R%   R  R#   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR$  _  s     *(   R   R   R&   R8   R   R   R   Rs   R   R   R   R  R  R   R   R$  (    (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s   	(			2	,					;t   UnzipCommandc           B   s   e  Z d  Z d Z RS(   R   s   Unzip individual packages(   R   R   R&   R   (    (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR)  i  s   c         C   s   |  d  j o t i d }  n t i |   \ } } | i o | o d g } n | p t i d  n | d i   } | t j o. t i d t	 i
 i t i d  | f  n t | } | i |  | d |  S(   Ni   R<   s?   You must give a command (use "pip help" see a list of commands)i    s   No command by the name %s %s(   R1   RT   RU   RV   Rc   R<   t   errorR  RY   R-   R.   R   R   (   t   initial_argsR^   Rz   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR   p  s    .
c         C   s   |  p t  i i d d  }  n |  o d |  j o |  i d d  \ } } d | j o | i d d  \ } } n; | } d d k } d | | f } t i | i |   } d	 | | | f S|  Sn d Sd S(
   s   Get the proxy given the option passed on the command line.  If an
    empty string is passed it looks at the HTTP_PROXY environment
    variable.t
   HTTP_PROXYRK   t   @i   t   :iNs   Password for %s@%s: s   %s:%s@%s(   R-   Ri   Rj   t   splitt   getpasst   urllibt   quoteR1   (   t   proxystrt   user_passwordt   server_portt   usert   passwordR0  t   prompt(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt	   get_proxy  s    c         C   sZ   t  |   } | oC t i h | d 6| d 6 } t i | t i  } t i |  n d S(   s   Set the proxy handler given the option passed on the command
    line.  If an empty string is passed it looks at the HTTP_PROXY
    environment variable.  t   httpt   ftpN(   R9  t   urllib2t   ProxyHandlert   build_openert   CacheFTPHandlert   install_opener(   R3  RH   t   proxy_supportt   opener(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRr     s
    c         C   sI   |  d  j o t i   }  n t   } t i |  t d |    | i   S(   Nt   file(   R1   RT   t   exc_infoR   t	   tracebackt   print_exceptiont   dictt   getvalue(   RD  t   out(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRv     s
    	c      
   C   s  t  i i |   }  t  i i |   py y d d k } Wn. t j
 o" d |  GHd GHt i d  n Xd |  GHt | _ t i	 d 7_	 | i
 |  d t n t i d	 j o t  i i |  d
 d  } n t  i i |  d d  } t  i i |  p
 |  } n t  i i |  p t d |   n t  i i t  i i |   } t } | i d  o | d  } n t  i | | | g | | d g  d S(   sT   
    Restart this script using the interpreter in the given virtual environment
    iNs*   The virtual environment does not exist: %ssG   and virtualenv is not installed, so a new environment cannot be createdi   s)   Creating new virtualenv environment in %si   t   site_packagesR   t   Scriptss
   python.exet   binR   s1   Cannot find virtual environment interpreter at %ss   .pycRa   (   R-   R.   R   R0   t
   virtualenvt   ImportErrorRT   R   R(   R   t   create_environmentR   t   platformR/   t
   BadCommandR"   t   __file__R   t   execv(   R?   Rz   RM  R   t   baseRC  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRm     s0    			
R   c           B   s   e  Z d  Z d Z d   Z d   Z d   Z d   Z d   Z e	 i
   Z d   Z e i d  Z e i d	 e i  Z e i d
  Z d   Z d   Z d   Z RS(   s   This finds packages.

    This is meant to match easy_install's technique for looking for
    packages, by reading pages and looking for appropriate links
    i   c         C   s7   | |  _  | |  _ g  |  _ t   |  _ t   |  _ d  S(   N(   R   R   R   t	   PageCachet   cacheR   t   logged_links(   R   R   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s
    			c         C   s   |  i  i |  d  S(   N(   R   R   (   R   t   links(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   add_dependency_links  s    c      !   C   s  | i  } t t i |  i d |   } |  i | |  } | d  j o& |  i t |  i d  | |  } n | d  j	 o; g  } |  i D] } | t i | |  q ~ |  i } n t	 |  i  } | i
 |  i  x> | i D]3 }	 | d  j	 o  t i | | |	  g | } q q Wg  }
 | D] } |
 t |  q ~
 } t i d |  x | D] } t i d |  qTWg  } | i
 |  i g  } |  i D] } | t | d  q~ | i i     xy |  i | |  D]e } t i d | i  t i d 7_ z) | i
 |  i | i | i i     Wd  t i d 8_ XqWt	 |  i g  } |  i D] } | t |  qQ~ | i i     } | oR t i d d i g  } | D] \ } } }	 | | i q~   | i
 |  n | p% t i d	 |  t d
 |   n | i d  j	 o& | i | i i t | i i f  n | i d t  g  } x | D] \ } } }	 |	 | i  j oT t i d | |	 d i g  } | i  i! D] } | d i |  q~  f  qWn | i | |	 f  qWWt" g  } | D]$ \ } }	 | t j o | | qq~  } | oa | oZ | d d t j o t i d | i i  n& t i d | i i t# d d f  d  S| pX t i d | d i g  } | D] \ } } }	 | |	 q~  f  t d |   n | d d t j oW t i d | i i d i g  } | d D] \ } }	 | |	 q#~  p d f  d  St$ |  d j oM t i d | d d d i g  } | D] \ } }	 | |	 q~  f  n | d d S(   Ni    s#   URLs to search for versions for %s:s   * %ss   -fs   Analyzing links from page %si   s   dependency_links found: %ss   , s<   Could not find any downloads that satisfy the requirement %ss$   No distributions at all found for %st   reverses-   Ignoring link %s, version %s doesn't match %st   ,RK   i   sL   Existing installed version (%s) is most up-to-date and satisfies requirementsU   Existing installed version (%s) satisfies requirement (most up-to-date version is %s)sN   Could not find a version that satisfies the requirement %s (from versions: %s)s,   No distributions matching the version for %ss=   Installed version (%s) is most up-to-date (past versions: %s)t   nones)   Using version %s (newest of versions: %s)(%   t   url_namet   Linkt	   posixpathR/   R   t	   _get_pageR1   t   _find_url_nameR   R   R   R   t   absolute_versionsR(   R   t   _package_versionsR&   R  t
   _get_pagest   urlR   RX  Ru   Rt   R	   t   satisfied_byRh   t   parsed_versiont   InfR9   R   Rk   R   t   specst   boolt   application_versionsR   (   R   R   R   R]  t   main_index_urlt   pageR#   Re  t	   locationsR9   t   _[2]R2   t   found_versionst   _[3]t   _[4]t   dependency_versionst   _[5]t   parsedR   t   applicable_versionsRg  t   _[6]t   st   _[7]t   existing_applicablet   _[8]t   _[9]t   _[10](    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   find_requirement  s    	&4
 $' = )EA& 	D>			;	I	Dc         C   s   | i  i d  p | i  d 7_  n |  i | |  } | d j o+ t i d |  t d | | f   n t | i  } x[ | i	 D]P } t
 i | i i d   } | t |  j o t i d | | f  | Sq Wd S(   s   Finds the true URL name of a package, when the given name isn't quite correct.
        This is usually used to implement case-insensitivity.R   s   Cannot fetch index base URL %ss2   Cannot find requirement %s, nor fetch index URL %ss!   Real name of requirement %s is %sN(   Re  R   R`  R1   R(   Rt   R	   t   normalize_nameR]  RX  R_  R   R.   R!  R   (   R   R   R]  R   Rm  t	   norm_nameR   RT  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRa  '  s    
 	c   
      C   s   t    } x | D] } | i |  q Wg  } t   } g  } xn t t d t |    D]Q } t i d |  i d | | | | f  }	 |	 i	 t
  | i |	  |	 i   qX Wx | D] }	 |	 i   q W| S(   s   Yields (page, page_url) from the given locations, skipping
        locations that have errors, and adding download/homepage linksi
   t   targetRz   (   R   t   putR   t   ranget   minR   t	   threadingt   Threadt   _get_queued_paget	   setDaemonRk   Rh   t   startR/   (
   R   Rn  R   t   pending_queueR2   t   donet   seent   threadst   it   t(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRd  :  s"    	 	 ' c         C   s   x y | i  t  } Wn t j
 o d  SX| | j o q n | i |  |  i | |  } | d  j o q n | i |  x! | i   D] } | i |  q Wq d  S(   N(	   Rj   R   t
   QueueEmptyR   R`  R1   Rh   t	   rel_linksR  (   R   R   R  R  R  R2   Rm  R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  N  s     s   #egg=([^&]*)s   ([a-z0-9_.]+)-([a-z0-9_.-]+)s   -py([123]\.[0-9])$c         c   s  h  } x| D]} | i  | j o q n d  | | i  <| i o | i } n | i } | i   \ } } | p< | |  i j o% t i d |  |  i i |  q q n | i	 d  o | d  } d | } n | d j oB | |  i j o+ t i d | | f  |  i i |  q q n |  i
 | | |  } | d  j o t i d	 | | f  q n |  i i |  }	 |	 oO | |	 i    } |	 i d
  }
 |
 t i d  j o t i d |  q qn t i d | | f  t i |  | | f Vq Wd  S(   Ns   Skipping link %s; not a files   .taris   .tar.gzs   .tar.bz2s   .tgzs   .zips,   Skipping link %s; unknown archive format: %ss-   Skipping link %s; wrong project name (not %s)i   i   s/   Skipping %s because Python version is incorrects   Found link %s, version: %s(   s   .tar.gzs   .tar.bz2s   .tars   .tgzs   .zip(   Re  R1   t   egg_fragmentR.   R#  RW  R(   R   R   R   t   _egg_info_matchest   _py_version_reR   R  t   groupRT   R9   R   t   parse_version(   R   RX  t   search_namet
   seen_linksR   t   egg_infoR.   R'  R9   R   t
   py_version(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRc  b  sL     
	
c         C   s   |  i  i |  } | p t i d |  d  S| i d  i   } | i d d  } | i | i    o! | i d  t	 |  i
 d  Sd  Sd  S(   Ns%   Could not parse version from link: %si    t   _R   (   t   _egg_info_reR   R(   R   R1   R  R  R"  R   R   R   (   R   R  R  R   R   R&   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s    !c         C   s   t  i | | d |  i S(   NRV  (   t   HTMLPaget   get_pageRV  (   R   R   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR`    s    (   R   R   R   t   failure_limitR   RY  R~  Ra  Rd  R  t   Lockt	   _log_lockR  R   t   compilet   _egg_fragment_ret   IR  R  Rc  R  R`  (    (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s   			J				)	R   c           B   s  e  Z d  e d  e d   Z e d  d   Z e d  d   Z d   Z	 d   Z
 d   Z d   Z e d    Z e d    Z e d	    Z e d
  Z d Z d   Z d   Z d   Z d   Z e d    Z e i d  Z d! d  Z e d    Z e d    Z d   Z d   Z d   Z  d   Z! d   Z" d   Z# d   Z$ e d    Z% d   Z& d   Z' e d    Z( RS("   c         C   s   t  | t  o t i i |  } n | |  _ | |  _ | |  _ | |  _ | |  _	 d  |  _ d  |  _ d  |  _ d  |  _ | |  _ d  S(   N(   t
   isinstancet
   basestringR   t   Requirementt   parseR   t
   comes_fromt
   source_dirt   editableRe  R1   t   _egg_info_pathRf  t   _temp_build_dirt
   _is_bundlet   update(   R   R   R  R  R  Re  R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s    									c      	   C   sW   t  |  \ } } | i d  o t |  } n d  } |  | | d | d t d | S(   Ns   file:R  R  Re  (   t   parse_editableR   t   url_to_filenameR1   Rk   (   R*   t   editable_reqR  R&   Re  R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s
    c         C   s   d } | } t |  o | } d } nL t |  o> t i i |  p t i d |  n t |  } d } n |  | | d | S(   sk   Creates an InstallRequirement from a name, which might be a
        requirement, filename, or URL.
        sA   Requirement %r looks like a filename, but the file does not existRe  N(	   R1   t   is_urlt   is_filenameR-   R.   R0   R(   R)   t   filename_to_url(   R*   R&   R  Re  R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s    
	
c         C   s   |  i  o2 t |  i   } |  i o | d |  i 7} qE n
 |  i } |  i d  j	 o | d t |  i i  7} n |  i o# |  i  o | d |  i 7} q n |  i oL t	 |  i t
  o |  i } n |  i i   } | o | d | 7} q n | S(   Ns    from %ss    in %ss    checkout from %ss
    (from %s)(   R   RJ   Re  Rf  R1   R   R2   R  R  R  R  t	   from_path(   R   Rx  R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   __str__  s"    

	


c         C   s^   t  |  i  } |  i oA t |  i t  o |  i } n |  i i   } | d | 7} n | S(   Ns   ->(   RJ   R   R  R  R  R  (   R   Rx  R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s    
c         C   s   |  i  d  j	 o |  i  S|  i d  j o& t i d d  |  _  | |  _ |  i  S|  i o |  i i   } n
 |  i } t	 i
 i |  p t	 i |  n t	 i
 i | |  S(   Ns   -builds   pip-(   R  R1   R   t   tempfilet   mkdtempt   _ideal_build_dirR  R&   R  R-   R.   R0   R   R/   (   R   R   R&   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   build_location  s    	
	c         C   sG  |  i  d j	 o d S|  i d j	 p t  |  i p t  |  i } |  i } |  ` |  i o |  i i   } n
 |  i } t	 i
 i | |  } t	 i
 i |  p" t i d |  t	 i |  n t	 i
 i |  o t d t |    n t i d |  t |  t |  f  t i | |  | |  _ | |  _  d |  _ d S(   sk   If the build location was a temporary directory, this will move it
        to a new more permanent locationNs   Creating directory %ss<   A package already exists in %s; please remove it to continues,   Moving package %s from %s to new location %s(   R  R1   R   RQ   R  R  R  R&   R  R-   R.   R/   R0   R(   R   R   R   R   R  R  R  (   R   t   old_locationt   new_build_dirR&   t   new_location(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   correct_build_location  s0    		
				c         C   s   |  i  d  j o d  S|  i  i S(   N(   R   R1   t   project_name(   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR&     s    c         C   s(   |  i  d  j o d  St i |  i  i  S(   N(   R   R1   R1  R2  t   unsafe_name(   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR]     s    c         C   s   t  i i |  i d  S(   Ns   setup.py(   R-   R.   R/   R  (   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   setup_py&  s    c         C   s  |  i  p t  |  i o t i d |  i  n t i d |  i  t i d 7_ z |  i } | i d t	 |  i
   } | i d t	 |  i   } |  i p | o
 g  } nI t i i |  i  d  } t i i |  p t i |  n d d g } t t i d | d	 g | d
 |  i  d |  i d t d t i d d Wd  t i d 8_ X|  i p- t i i |  i   d  |  _ |  i   n d  S(   Ns(   Running setup.py egg_info for package %ss-   Running setup.py egg_info for package from %si   t   __SETUP_PY__t   __PKG_NAME__s   pip-egg-infos
   --egg-bases   -cR  t   cwdt   filter_stdoutt   show_stdoutt   command_levelt   command_descs   python setup.py egg_infot   Name(   R  RQ   R&   R(   R   Re  R   t   _run_setup_pyR"  t   reprR  R  R-   R.   R/   R0   R   t   call_subprocessRT   t
   executablet   _filter_installR   Rd   t   VERBOSE_DEBUGR   R   R  R  t   pkg_infoR  (   R   R   t   scriptt   egg_base_optiont   egg_info_dir(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   run_egg_info*  s0    
	
	
s  
__file__ = __SETUP_PY__
from setuptools.command import egg_info
def replacement_run(self):
    self.mkpath(self.egg_info)
    installer = self.distribution.fetch_build_egg
    for ep in egg_info.iter_entry_points('egg_info.writers'):
        # require=False is the change we're making:
        writer = ep.load(require=False)
        writer(self, ep.name, egg_info.os.path.join(self.egg_info,ep.name))
    self.find_sources()
egg_info.egg_info.run = replacement_run
execfile(__file__)
c         C   s   |  i  d  j	 o) |  i  i |  p d  S|  i  i |  S|  i p t  |  i |  } t i i	 |  p d  St
 | d  } | i   } | i   | S(   NR  (   Rf  R1   R   t   get_metadataR  RQ   t   egg_info_pathR-   R.   R0   R   R   Rw   (   R   R   t   fpt   data(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   egg_info_dataZ  s    
c      
   C   s  |  i  d  j oc|  i o |  i } n t i i |  i d  } t i |  } |  i o g  } x t i |  D]x \ } } } x/ t	 i
 D]$ } | | j o | i |  q q W| i g  } | D] } | t i i | |  q ~  qn Wg  }	 | D]! }
 |
 i d  o |	 |
 q q ~	 } n t |  d j p t d | d i |  f  t i i | | d  |  _  n t i i |  i  |  S(   Ns   pip-egg-infos	   .egg-infoi   s&   Unexpected files/directories in %s: %st    i    (   R  R1   R  R  R-   R.   R/   R  R  t   vcsR%   t   removeR   R   R   RQ   (   R   R   RT  R  t   roott   dirst   filest   dirR#   Ro  R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  h  s&    

 
 .90 c         C   st   |  i  |  } | p g  Sg  } xL | i   D]> } | i   } | p | i d  o q. n | i |  q. W| S(   NR   (   R  t
   splitlinesR   R   Rh   (   R   R   R  R   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   egg_info_lines|  s     c         C   sa   t    } |  i d  } | p$ t i d t |  i d    n | i | p d  | i   S(   Ns   PKG-INFOs   No PKG-INFO file found in %sRK   (   R   R  R(   R)   R   R  t   feedRw   (   R   t   pR  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s    	$c         C   s   |  i  d  S(   Ns   dependency_links.txt(   R  (   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s    s	   \[(.*?)\]c         c   ss   d  } xf |  i d  D]U } |  i i |  } | o | i d  } q n | o | | j o q n | Vq Wd  S(   Ns   requires.txti   (   R1   R  t   _requirements_section_reR   R  (   R   t   extrast   in_extraR   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s     c         c   s7   x0 |  i  i D]" \ } } | d j o	 | Vq q Wd  S(   Ns   ==(   R   Ri  (   R   t	   qualifierR9   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRb    s     c         C   s   |  i    d S(   NR9   (   R  (   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   installed_version  s    c         C   s   |  i  p t  |  i d j o d  S|  i } | |  i j oI t i d t |  i   | |  f  t d t |  i   | |  f   n$ t i	 d t |  i   | |  f  d  S(   Ns   command linesH   Source in %s has the version %s, which does not match the requirement %ss2   Source in %s has version %s that conflicts with %ss;   Source in %s has version %s, which satisfies requirement %s(
   R  RQ   R  R  R   R(   Rt   R   R   R   (   R   R9   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   assert_source_matches_version  s    	 	c         C   s	  |  i  p t i d |  i  d  S|  i p t  |  i p t  |  i  i d  o d  Sd |  i  j p t d |  i   |  i p d  S|  i  i d d  \ } } | i	   } t
 i |  } | o | |  i   i |  i  n d p t d |  i  | f  d  S(   Ns>   Cannot update repository at %s; repository location is unknowns   file:t   +s   bad url: %ri   i    s+   Unexpected version control type (in %s): %s(   Re  R(   Ru   R  R  RQ   R   R  R/  R  R  R5   t   obtain(   R   R3   Re  t   version_control(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   update_editable  s$    
!

c         C   sr  |  i  o |  i   d  St i d j o t i i t i d  } n' t i i t i d d t i d   } t	 i
 d d  } t i i | d  } t i i t i i t i i |  i   d d	  } t i d
 |  i  t i d 7_ zX t t i d d |  i |  i f d d d | d | g	 | d |  i d |  i d t Wd  t i d 8_ Xt |  } xJ | D]- } | i   } | i d  o | } PqfqfWt i d |   d  S| i   g  }	 t |  } xW | D]O } | i   }
 t i i |
  o |
 t i i 7}
 n |	 i t |
 |   qW| i   t t i i | d  d  } | i d i |	  d  | i   d  S(   NR   t   Libt   libs   python%si   s   -records   pip-s   install-record.txtt   includes   Running setup.py install for %si   s   -cs,   import setuptools; __file__=%r; execfile(%r)R   s#   --single-version-externally-manageds   --records   --install-headersR  R  R  s	   .egg-infos;   Could not find .egg-info directory in install record for %ss   installed-files.txtR   s   
(    R  t   install_editableRT   RP  R-   R.   R/   t   prefixR9   R  R  R"   R  R(   R   R&   R   R  R  R  R  R   R   R   R   R)   Rw   R   R	  Rh   t   make_path_relativeRx   (   R   R   t   install_locationt   temp_locationt   record_filenamet
   header_dirR   R   R  R  R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     sR    

&3	 	
 
c         C   s   |  i  p t i i |  i  o| t i d |  i  |  i o t i	 |  i  n d |  _ |  i o* t i i |  i  o t i	 |  i  n d |  _ n d S(   sV   Remove the source files from this requirement, if they are marked
        for deletions   Removing source in %sN(   t	   is_bundleR-   R.   R0   t   delete_marker_filenameR(   Ru   R  R  R
  R1   R  (   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   remove_temporary_source  s     
	 c         C   s   t  i d |  i  t  i d 7_ zH t t i d d |  i |  i f d d g d |  i d |  i	 d	 t
 Wd  t  i d 8_ Xd  S(
   Ns   Running setup.py develop for %si   s   -cs,   import setuptools; __file__=%r; execfile(%r)t   develops	   --no-depsR  R  R  (   R(   R   R&   R   R  RT   R  R  R  R  R   (   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s    	c         C   sc   t  i } xM d d d d d d d d g D]- } t i | | i    o t  i } Pq( q( W| | f S(	   Ns   ^running .*s   ^writing .*s   ^creating .*s   ^[Cc]opying .*s   ^reading .*s4   ^removing .*\.egg-info' \(and everything under it\)$s   ^byte-compiling s7   ^warning: manifest_maker: standard file '-c' not found$(   Rd   t   NOTIFYR   R   R   t   INFO(   R   R   R|   t   regex(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s    	 		c         C   sR   |  i  d j o t Sy t i |  i   } Wn t i j
 o t SX| |  _ t S(   sF   Checks if this requirement is satisfied by something already installedN(   R   R1   R   R   t   get_distributionR	   Rf  Rk   (   R   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   check_if_exists*  s    	c         C   sz   |  i  d  j	 o |  i  S|  i } | p t St i i t i i | d   p t i i t i i | d   |  _  |  i  S(   Ns   pip-manifest.txts   pyinstall-manifest.txt(   R  R1   R  R   R-   R.   R0   R/   (   R   RT  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  5  s    	"$c         c   s  |  i  } | p t  t i i | d  } t i i | d  } t i i |  oxt i |  D] } x t i D] } d  } } t i i | | | i
  } t i i |  oH | i }	 t |  }
 |
 i   } |
 i   |   i |  \ } } Pqt qt W| o d |	 | | f } n d  } t | |  d t d | d t d t i i | |  Vqd Wn t i i |  oA x> t i |  D]) } t | |  d t i i | |  VqWn d  S(   NR   R   s   %s+%s@%sR  Re  R  R  (   R  RQ   R-   R.   R/   R0   R  R  R!   R1   t   bundle_fileR&   R   R   Rw   t   parse_checkout_textR   Rk   R   (   R   RT  R   R   R  t   vcs_backendRe  t   revt   vcs_bundle_fileR3   R  R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   bundle_requirementsA  s>    	 
 
		
	% 	c   
      C   s<  |  i  } | p t  t i i | d  } t i i | d  } x | | f | | f g D] \ } } t i i |  o x t i |  D] } t i i | |  }	 t i i |	  o! t i d |	 | |  f  q n t i i |  p" t i	 d |  t i
 |  n t i t i i | |  |	  q WqZ qZ Wd  S(   NR   R   sZ   The directory %s (containing package %s) already exists; cannot move source from bundle %ss   Creating directory %s(   R  RQ   R-   R.   R/   R0   R  R(   R)   Ru   R   R  R  (
   R   t   dest_build_dirt   dest_src_dirRT  R   R   R  t   dest_dirR"   R;   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   move_bundle_filesa  s&    	  	c         C   s'   |  i  p t  t i i |  i  d  S(   Ns   pip-delete-this-directory.txt(   R  RQ   R-   R.   R/   (   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  t  s    N(    ()   R   R   R1   R   Rk   R   t   classmethodR   R   R  R  R  R  R7   R&   R]  R  R  R  R  R  R  R  R   R   R  R  R   Rb  R  R  R  R   R  R  R  R  R  R  R  R  (    (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     sF   		
		.							1					 	s   This file is placed here by pip to indicate the source was put
here by pip.

Once this package is successfully installed this source code will be
deleted (unless you remove this file).
R   c           B   s   e  Z e e d   Z d   Z d   Z d   Z d   Z e d  Z d   Z	 d   Z
 e d  Z d	   Z d
   Z d   Z d Z d   Z d   Z RS(   c         C   sC   | |  _  | |  _ | |  _ | |  _ h  |  _ h  |  _ g  |  _ d  S(   N(   R   R   R   R   R   t   requirement_aliasest   unnamed_requirements(   R   R   R   R   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s    						c         C   s|   g  } |  i  i   D] } | i p | | q q ~ } | i d d    d i g  } | D] } | t | i  q\ ~  S(   NR   c         S   s   |  i  i   S(    (   R&   R  (   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s    R  (   R   R    R  R   R/   RJ   R   (   R   R#   R   t   reqsRo  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s    c         C   s   | i  } | p |  i i |  nn |  i |  o& t d | |  i |  | f   n | |  i | <| i   | j o | |  i | i   <n d  S(   Ns4   Double requirement given: %s (aready in %s, name=%r)(	   R&   R  Rh   t   has_requirementR   t   get_requirementR   R  R  (   R   t   install_reqR&   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s    	 c         C   sF   x? | | i    f D]+ } | |  i j p | |  i j o t Sq Wt S(   N(   R  R   R  Rk   R   (   R   R  R&   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s
      	c         C   sp   xY | | i    f D]E } | |  i j o |  i | S| |  i j o |  i |  i | Sq Wt d |   d  S(   Ns   No project with the name %r(   R  R   R  R  (   R   R  R&   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s     c         C   s  t  |  i  } |  i i   } xe| p | oV| o | i d  } n | i d  } t } |  i o1 | i o& |  i o | i	   o
 t
 } q n | i d  j	 o  |  i o t i d |  nx | i o t i d |  nY | i o= | i i   i d  o$ t i d t t | i    n t i d |  t i d 7_ t
 } z| i oP | i d  j o | i |  i  } | | _ n
 | i } | i   | i   n| o| i |  i  } t }	 t i i t i i | d   p | i d  j o | i | d	 |  i }
 n t  | i  }
 |
 p t!  |
 oc y |  i" |
 |  Wqt# i$ j
 o9 } t i% d
 | | f  t& d | | |
 f   qXqt
 }	 n |	 o | i' } | oK x. | i(   D]  } | i) |  |  i* |  qW| i+ |  i |  i  qx| | _ | i   | o | i d t  n | i,   t- | i. d  } | i/ t0  | i1   q|n | p | i2 | i3  x | i   D] } y t4 i5 i6 |  i7 } Wn2 t8 j
 o& } t i9 d | | | f  qn X|  i: |  o qn t; | |  } | i) |  |  i* |  qW| i< |  i j o | |  i | i< <qmn | i=   Wd  t i d 8_ Xq! Wd  S(   Ni    s!   Requirement already satisfied: %ss   Checking out %ss   file:s   Unpacking %ss   Downloading/unpacking %si   s   setup.pyR   s4   Could not install requirement %s because of error %ssD   Could not install requirement %s because of HTTP error %s for URL %sR   R   s.   Invalid requirement: %r (%s) in requirement %s(>   R   R  R   R    t   popRk   R   R  R   R  R   Rf  R1   R(   R   Re  R  R   R   R  R   R  R  R   R  R  R   R-   R.   R0   R/   R~  R^  RQ   t
   unpack_urlR<  t	   HTTPErrorRt   R   R  R  Rh   R   R  R  R   R  Rx   t   DELETE_MARKER_MESSAGERw   RY  R   R   R  R  R  t
   ValueErrorR*  R  R   R&   R  (   R   R   R   t   unnamedR  t   req_to_installR   R  R2   t   unpackRe  R   t   subreqR   R   R&   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s     !
#$
	
"	
	 	

 c         C   sT  x< t  i D]1 } | i | i j o | |  i |  d  Sq
 Wt i   } | i i   i	 d  o9 t
 | i  } t i |  } |  i | | | |  d  S| i } | i i d d  d } d  }	 t i i d  o, t i i t i d t i | d   }	 n |	 o t i i |	  o t i i |	 d  o t |	 d  }
 |
 i   i   } |
 i   | oT t   } t |	 d  }
 x+ |
 i d	  } | p Pn | i |  q|
 i   n |	 } t i  d
 |	  ny t! i" |  } Wnc t! i# j
 o& } t i$ d | i% | f    n0 t& j
 o# } t i$ d | | f    n X| i'   d } | i( } t) |  } | p t i* |  } | | 7} n t i i | |  } t | d  }
 | o t   } n y t+ | i'   d  } Wn t, t- f j
 o d } n Xd } | d j p | } | i. } z| o= | o! t i/ d | t0 |  f  qt i/ d |  n t i  d |  t i1 d |  x | i d	  } | p Pn | t2 |  7} | oK | p t i3 d t0 |   qt i3 d d | | t0 |  f  n | o | i |  n |
 i4 |  q|
 i   Wd  | o t i5 d t0 |   n X| oK | i6   } | | j o. t i$ d | | | f  t7 d |   qn |  i | | | |  |	 ob |	 | j oU t i  d t8 |	   t9 i: | |	  t |	 d d  }
 |
 i4 |  |
 i   n t i; |  d  S(   Ns   file:R   i   i    t   PIP_DOWNLOAD_CACHERK   s   .content-typet   rbi   s   Using download cache from %ss   HTTP error %s while getting %ss   Error %s while getting %ss   content-typeR   s   content-lengthi(   i  s   Downloading %s (%s): s   Downloading %s (unknown size): s   Downloading %ss   Downloading from URL %ss   %ss	   %3i%%  %sid   s   %s downloadedsC   MD5 hash of the package %s (%s) doesn't match the expected hash %s!s   Bad MD5 hash for package %ss   Storing download in cache at %sR   i@  (<   R  R!   t   schemeR   R  R  R  Re  R  R   R  t	   mimetypest
   guess_typet   unpack_filet   md5_hashR/  R1   R-   Ri   Rj   R.   R/   R1  R2  R0   R   R   R   Rw   R    R  R(   R   R<  t   urlopenR  Rt   t   codet   IOErrorRu   R   R#  t   guess_extensiont   intR  R  t   show_urlt   start_progresst   format_sizeR   R   t   show_progressRx   t   end_progresst	   hexdigestR   R   R  t   copyfileR   (   R   R   R2   R$   R  t   sourcet   content_typeR#  t
   target_urlt   target_fileR  t   download_hasht   chunkR  t   respR   R   R'  t   total_lengtht
   downloadedR,  R)  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s    
 		
			!)	c         C   s  | d j p0 | i  d  p  | i  d  p t i |  o$ |  i | | d | i  d  n | d j p- t i |  p t |  d i   d j o |  i | |  nl | i	 d  o1 t
 t |   o t d | i  i |  n+ t i d | | | f  t d |   d  S(   Ns   application/zips   .zips	   .pybundlet   flattens   application/x-gzipi   s   .tars   .tar.gzs   .tar.bz2s   .tgzs	   text/htmls   svn+sZ   Cannot unpack file %s (downloaded from %s, content-type: %s); cannot detect archive formats%   Cannot determine archive format of %s(   s   .tars   .tar.gzs   .tar.bz2s   .tgz(   R   R   R   t
   unzip_filet   tarfilet
   is_tarfileR#  R  t
   untar_fileR   t   is_svn_paget   file_contentst
   SubversionRe  R  R(   Rt   R   (   R   R   R2   R1  R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR"  v  s    $	c      	   C   si  t  i i |  p t  i |  n t | d  } z$t i |  } t | i    o | } x | i   D] } | i	 |  } | }	 | o t
 |  d }	 n t  i i | |	  }	 t  i i |	  }
 t  i i |
  p t  i |
  n |	 i d  o( t  i i |	  p t  i |	  qRqk t |	 d  } z | i |  Wd | i   Xqk WWd | i   Xd S(   sQ   Unzip the file (zip file located at filename) to the destination
        locationR  i   R   R   N(   R-   R.   R0   R   R   R   R   t   has_leading_dirR   R   t   split_leading_dirR/   R"   R   Rx   Rw   (   R   R   R2   R9  t   zipfpR   t   leadingR&   R  R  R  R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR:    s0     c         C   sP  t  i i |  p t  i |  n | i   i d  p | i   i d  o
 d } nX | i   i d  o
 d } n8 | i   i d  o
 d } n t i d |  d	 } t i	 | |  } z{t
 g  } | i   D] } | | i q ~  } xD| i   D]6} | i } | o t |  d
 } n t  i i | |  }	 | i   o( t  i i |	  p t  i |	  q9qy | i |  }
 Wn5 t j
 o) } t i d | | i | f  qn Xt  i i t  i i |	   p t  i t  i i |	   n t	 |	 d  } z t i |
 |  Wd | i   X|
 i   qWWd | i   Xd S(   sI   Untar the file (tar file located at filename) to the destination locations   .gzs   .tgzs   r:gzs   .bz2s   r:bz2s   .tarR  s-   Cannot determine compression type for file %ss   r:*i   s/   In the tar file %s the member %s is invalid: %sR   N(   R-   R.   R0   R   R  R   R(   R)   R;  R   RA  t
   getmembersR&   RB  R/   R   t   extractfileR  R"   R  t   copyfileobjRw   (   R   R   R2   t   modet   tarR#   t   memberRD  R  R.   R  R   t   destfp(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR=    sJ    ,


0 	c         C   s   t  |  i i   d d   } t i d d i g  } | D] } | | i q8 ~   t i d 7_ zL xE |  i i   D]4 } | i d j	 o qx n | i
 |  | i   qx WWd t i d 8_ Xd S(   sR   Install everything in this set (after having downloaded and unpacked the packages)R   c         S   s   |  i  i   S(    (   R&   R  (   R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s    s!   Installing collected packages: %ss   , i   N(   R   R   R    R(   R   R/   R&   R   Rf  R1   R   R  (   R   R   R   R#   R   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s    8 c         C   s  t  i | d t  i  } g  } xT|  i d f |  i d f f D]4\ } } t i i t i i |   } xt i	 |  D]\ } } } x t
 i D] }	 |	   }
 d  } } |
 i | j o xT | D] } | i |  o Pq q W|
 i t i i | |   \ } } | i |  |
 i } |
 i h | d 6| d 6} | i |
 i  Pq q Wd | j o | i d  n xQ | D]I } t i i | |  } |  i | |  } | i | d | d d  qrWxa | D]Y } | d	 j o qn t i i | |  } |  i | |  } | i | | d |  qW| oC t i i | |  } |  i | |  } | i | d | |  qw qw Wq= W| i d
 |  i    | i   t i d |  i |  i f  x> |  i |  i f D]* } t i i |  o t i |  qqWd  S(   NR   R   R   Re  R  s   pip-egg-infoR   RK   s   pip-delete-this-directory.txts   pip-manifest.txts1   Removing temporary build dir %s and source dir %s(   R   R   t   ZIP_DEFLATEDR   R   R-   R.   R   R   R  R  R!   R1   R"   R   t   get_infoR/   Rh   R  t   guideR  t   _clean_zip_nameR   Rx   R  Rw   R(   Ru   R0   R  R
  (   R   R   R   t   vcs_dirsR  R   R  R%   R  R$   R  t   vcs_urlt   vcs_revt   vcs_dirR  t	   vcs_guideR"   R&   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     sd      
 	
 			   $
	 s   # This is a pip bundle file, that contains many source packages
# that can be installed as a group.  You can install this like:
#     pip this_file.zip
# The rest of the file contains a list of all the packages included:
c         C   s  |  i  g } xl t g  } |  i i   D] } | i p | | q& q& ~ d d   D]# } | i d | i | i f  qT W| i d  xl t g  } |  i i   D] } | i o | | q q ~ d d   D]# } | i d | i | i f  q Wd i |  S(   NR   c         S   s   |  i  S(    (   R&   (   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR   +  s    s   %s==%s
sC   # These packages were installed to satisfy the above requirements:
c         S   s   |  i  S(    (   R&   (   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR   1  s    RK   (	   t   BUNDLE_HEADERR   R   R    R  Rh   R&   R  R/   (   R   t   partsR#   R   Ro  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  &  s    
 !
 !c         C   sX   | i  | d  p t d | | f  | t |  d } | i t i i d  } | S(   NR   s$   name %r doesn't start with prefix %ri   (   R   RQ   R   R"  R-   R.   R	  (   R   R&   R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRO  6  s
    (   R   R   R   R   R  R   R  R  R   R  R"  Rk   R:  R=  R   R   RU  R  RO  (    (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s   
				a	f		-		>	R  c           B   s   e  Z d  Z e i d e i  Z e i d e i  Z e i d e i  Z e i d e i e i	 B Z
 d d  Z d   Z e d e d   Z e d    Z e d	    Z d
   Z d d  Z d   Z e i d e i  Z d   Z RS(   s'   Represents one page, along with its URLs   <th>\s*home\s*pages   <th>\s*download\s+urls&   <[^>]*\srel\s*=\s*['"]?([^'">]+)[^>]*>s(   href=(?:"([^"]*)"|'([^']*)'|([^>\s\n]*))c         C   s   | |  _  | |  _ | |  _ d  S(   N(   R  Re  t   headers(   R   R  Re  RW  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR   G  s    		c         C   s   |  i  S(   N(   Re  (   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  L  s    c      	   C   s8  | i  } | i d d  d } | i |  o d  S| i   i d  o t i d |  d  S| d  j	 o% | i |  } | d  j	 o | Sn y%| o | d  j	 o | i	 |  o d  Sn | i
 } x d d d d	 d
 g D]} } | i |  og |  i |  }	 |	 i   i d  o Pq^t i d | |	 f  | d  j	 o | i |  n d  Sq q Wn t i d |  t i |  }
 |
 i   } |
 i   } |  |
 i   | |  } WnSt i t i t i t i f j
 o/} t |  } t | t i  o t i } d } d } n t | t i  oI t i } t | d  o& t | i t i  o d } d } qd } nF t | t i  o# | i d j o t i } d } n t i } d } | d | | f  | d | i  | f  | d  j	 o | i | |  n d  SX| d  j	 o | i | | g |  n | S(   NR   i   i    t   svns   Cannot look at svn URL %ss   .tars   .tar.gzs   .tar.bz2s   .tgzs   .zips	   text/htmls,   Skipping page %s because of Content-Type: %ss   Getting page %ss	   timed outt   reasoni   i  s   Could not fetch URL %s: %ss7   Will skip URL %s when looking for download links for %s(    Re  R/  t   too_many_failuresR1   R  R   R(   R   R  t
   is_archiveR   R   t   _get_content_typet   set_is_archiveR<  R$  t   geturlRu   R   R  t   URLErrorRp   RM   R*  RJ   R  R)   R'   RY  R%  t   add_page_failuret   add_page(   R*   R   R   RV  t   skip_archivesRe  t   instR   t   bad_extR1  R6  t   real_urlRW  R   t   desct   log_methR|   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  O  sr    				 (	
	&

#	
	c   	   
   C   s   t  i |   \ } } } } } | d j o t i } n | d j o t i } n d S| o | d | 7} n | |  } zV | i d | d h | d 6| i   } | i d j o d S| i d	  p d SWd
 | i	   Xd
 S(   s;   Get the Content-Type of the given url, using a HEAD requestR:  t   httpsRK   t   ?t   HEADRW  t   Hosti   s   Content-TypeN(
   R   t   urlsplitt   httplibt   HTTPConnectiont   HTTPSConnectiont   requestt   getresponset   statust	   getheaderRw   (	   Re  R  t   netlocR.   t   queryt   fragmentt	   ConnClasst   connR6  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR\    s     c         c   s   xx |  i  i |  i  D]a } | i d  p | i d  p | i d  } |  i t i |  i |   } t | |   Vq Wd S(   s   Yields all links in the pagei   i   i   N(	   t   _href_ret   finditerR  R  t
   clean_linkR   t   urljoinRe  R^  (   R   R   Re  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRX    s
     /c         c   s<   x |  i    D] } | Vq Wx |  i   D] } | Vq) Wd  S(   N(   t   explicit_rel_linkst   scraped_rel_links(   R   Re  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s     	 t   homepaget   downloadc         c   s   x |  i  i |  i  D] } | i d  i   i   } x# | D] } | | j o Pq> q> Wq |  i i | i d   } | p q n | i d  p | i d  p | i d  } |  i t	 i
 |  i |   } t | |   Vq Wd S(   s)   Yields all links with the given relationsi   i    i   i   N(   t   _rel_reRz  R  R  R  R/  Ry  R   R{  R   R|  Re  R^  (   R   t   relsR   t
   found_relst   relRe  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR}    s      	/c         c   s   x |  i  |  i f D] } | i |  i  } | p q n |  i i |  i d | i   } | p q n | i d  p | i d  p | i d  } | p q n |  i t i	 |  i
 |   } t | |   Vq Wd  S(   Nt   posi   i   i   (   t   _homepage_ret   _download_reR   R  Ry  t   endR  R{  R   R|  Re  R^  (   R   R   R   t
   href_matchRe  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR~    s     !/s   [^a-z0-9$&+,/:;=?@.#%_\\|-]c         C   s   |  i  i d   |  S(   s   Makes sure a link is fully encoded.  That is, if a ' ' shows up in
        the link, it will be rewritten to %20 (while not over-quoting
        % or other characters).c         S   s   d  t  |  i d   S(   s   %%%2xi    (   t   ordR  (   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s    (   t	   _clean_ret   sub(   R   Re  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR{    s    	N(   R  R  (   R   R   R   R   R  R  R  R  R  t   SRy  R1   R   R  R  Rk   R  t   staticmethodR\  R7   RX  R  R}  R~  R  R{  (    (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  =  s    	>		RU  c           B   sV   e  Z d  Z d Z d   Z d   Z d   Z d   Z e d  Z	 d   Z
 d   Z RS(	   s   Cache of HTML pagesi   c         C   s   h  |  _  h  |  _ h  |  _ d  S(   N(   t	   _failurest   _pagest	   _archives(   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s    		c         C   s   |  i  i | d  |  i j S(   Ni    (   R  Rj   R  (   R   Re  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRZ    s    c         C   s   |  i  i |  S(   N(   R  Rj   (   R   Re  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s    c         C   s   |  i  i | t  S(   N(   R  Rj   R   (   R   Re  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR[    s    c         C   s   | |  i  | <d  S(   N(   R  (   R   Re  t   value(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR]    s    c         C   s$   |  i  i | d  | |  i  | <d  S(   Ni    (   R  Rj   (   R   Re  R|   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR`    s    c         C   s"   x | D] } | |  i  | <q Wd  S(   N(   R  (   R   t   urlsRm  Re  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRa    s     (   R   R   R   R  R   RZ  R  R[  Rk   R]  R`  Ra  (    (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRU    s   					R^  c           B   s   e  Z d d   Z d   Z d   Z e d    Z e d    Z e d    Z	 d   Z
 e i d  Z e d    Z e i d	  Z e d
    Z e d    Z RS(   c         C   s   | |  _  | |  _ d  S(   N(   Re  R  (   R   Re  R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s    	c         C   s*   |  i  o d |  i |  i  f S|  i Sd  S(   Ns   %s (from %s)(   R  Re  (   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s    
c         C   s   d |  S(   Ns	   <Link %s>(    (   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   __repr__	  s    c         C   sl   |  i  } | i d d  d } | i d d  d } | i d  } t i |  } | p t d |  | S(   NR   i   i    Ri  R   s   URL %r produced no filename(   Re  R/  R!  R_  R   RQ   (   R   Re  R&   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR   	  s    	
c         C   s   t  i |  i  d S(   Ni    (   R   Rl  Re  (   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  	  s    c         C   s   t  i |  i  d S(   Ni   (   R   Rl  Re  (   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR.   	  s    c         C   s   t  t i |  i i d    S(   NR   (   R#  R_  R   R.   R!  (   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR#  	  s    s   #egg=([^&]*)c         C   s.   |  i  i |  i  } | p d  S| i d  S(   Ni   (   R  R   Re  R1   R  (   R   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR   	  s    s   md5=([a-f0-9]+)c         C   s.   |  i  i |  i  } | o | i d  Sd  S(   Ni   (   t   _md5_reR   Re  R  R1   (   R   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR#  )	  s    c         C   s0   t  i |  i i d d  d i d d  d  S(   NR   i   i    Ri  (   R_  R   Re  R/  (   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR)  0	  s    N(   R   R   R1   R   R  R  R7   R   R  R.   R#  R   R  R  R  R  R#  R)  (    (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR^    s   			R   c           B   s\   e  Z d d   Z e i d  Z e i d  Z e e d   Z	 e
 d    Z d   Z RS(   c         C   s(   | |  _  | |  _ | |  _ | |  _ d  S(   N(   R&   R   R  t   comments(   R   R&   R   R  R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR   :	  s    			s   -r(\d+)$s   -(20\d\d\d\d\d\d)$c         C   s  t  i i t  i i | i   } g  } t i |  o] t } t | | |  } | d  j o4 t
 i d |  | i d  | i   } t } qnGt } | i   } | i } t |  d j o | d d d j p t  | d d }	 |  i i |	  }
 |  i i |	  } |
 p | o t i d  } | o |   i | |  } n | p" t
 i d |  | i d  q| i d	 |  |
 o |
 i d  } n d
 | i d  } t } d | | |  i |  f } n |  | i | | |  S(   Ns-   Could not determine repository location of %ss-   ## !! Could not determine repository locationi   i    s   ==RX  s(   Warning: cannot find svn location for %ssF   ## FIXME: could not find svn URL in dependency_links for this package:s3   # Installing as editable to satisfy requirement %s:s   {%s}s   svn+%s@%s#egg=%s(   R-   R.   R   R   R2   R  R4   Rk   t   get_src_requirementR1   R(   R)   Rh   t   as_requirementR   Ri  R   RQ   t   _rev_reR   t   _date_reR5   t   get_locationR  t   egg_nameR  (   R*   R   R   R   R2   R  R  R   Ri  R9   t	   ver_matcht
   date_matcht   svn_backendt   svn_locationR  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR   C	  sB    !	/	 c         C   s=   |  i    } t i d |  } | o | | i    } n | S(   Ns
   -py\d\.\d$(   R  R   R   R  (   R   R&   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  j	  s
    c         C   sH   |  i  } |  i o d | } n d i t |  i  t |  g  d S(   Ns   -e %ss   
(   R   R  R/   R   R  RJ   (   R   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  r	  s    	
(    (   R   R   R   R   R  R  R  R  R   R   R  R  R  (    (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR   8	  s   &t   VersionControlc           B   sJ   e  Z d  Z d d  Z d   Z d   Z d   Z d   Z e	 d  Z
 RS(   RK   c         O   s&   | |  _  t t |   i | |   d  S(   N(   Re  R   R  R   (   R   Re  Rz   t   kwargs(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR   {	  s    	c         C   s   t  i | f S(   N(   Rd   R  (   R   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   _filter	  s    c         C   s   |  i  i d d  d } t i |  \ } } } } } d | j o | i d d  \ } } n d } t i | | | | d f  } | | f S(   sm   
        Returns the correct repository URL and revision by parsing the given
        repository URL
        R  i   R-  RK   N(   Re  R/  R   Rl  R1   t
   urlunsplit(   R   Re  R  Rt  R.   Ru  t   fragR  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   get_url_rev	  s    c         C   s
   t   d  S(   N(   t   NotImplementedError(   R   R;   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  	  s    c         C   s
   t   d  S(   N(   R  (   R   R2   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  	  s    c         C   s
   t   d  S(   N(   R  (   R   R   R2   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  	  s    N(   R   R   R&   R1   R   R  R  R  R  R   R  (    (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  x	  s   				s   url="([^"]+)"s   committed-rev="(\d+)"s	   URL: (.+)s   Revision: (.+)R@  c           B   s   e  Z d  Z d Z d Z d Z d Z d   Z d   Z d   Z	 d   Z
 d	   Z d
   Z d   Z d   Z d   Z e d  Z RS(   RX  s   .svns   svn+sshs   svn-checkout.txtsg   # This was an svn checkout; to make it a checkout again run:
svn checkout --force -r %(rev)s %(url)s .
c         C   s  | i  d  i d  p t d |  t d d | g d t d h d d	 6} t i |  } | p- t i d
 t	 |   t i
 d |  d S| i d  i   } t i |  } | p3 t i d t	 |   t i
 d |  | d f S| | i d  f S(   s/   Returns (url, revision), where both are stringsR   s   .svns   Bad directory: %sRX  Ru   R  t   extra_environt   Ct   LANGs'   Cannot determine URL of svn checkout %ss!   Output that cannot be parsed: 
%st   unknowni   s,   Cannot determine revision of svn checkout %s(   s   unknowns   unknown(   R!  R   RQ   R  R   t   _svn_url_reR   R(   R)   R   Ru   R  R   t   _svn_revision_re(   R   R2   t   outputR   Re  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRM  	  s    (%c         C   s   x | i    D] } | i   p | i   i d  o q n t i d |  } | p d S| i d  } | | i   i   i d  d  d } | | f SWd S(   NR   s   ^-r\s*([^ ])?i   i    (   NN(   NN(	   R  R   R   R   R   R1   R  R  R/  (   R   R   R   R   R  t   rest(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  	  s     $&c      	   C   s   |  i    \ } } t i d | | f  t i d 7_ zM t i i |  o t i |  n t d d | | g d |  i	 d t
 Wd t i d 8_ Xd S(   sC   Check out the svn repository at the url to the destination locations$   Checking out svn repository %s to %si   RX  t   checkoutR  R  N(   R  R(   R   R   R-   R.   R0   t   rmdirR  R  R   (   R   R2   Re  R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  	  s    c   
      C   s_  |  i    \ } } | o d | g } d | } n g  } d } t } t i i t i i | d   o|  i |  d } t } | | j oY t i	 d t
 |  | f  t i d t
 |  | f  t d d	 g | | g  qt i d
 t
 |  | f  t i d |  t d d  } | d j oB t i d t
 |  | | f  t d d g | | | g  q| d j o q| d j o. t i d t
 |   t i |  t } q| d j o@ t |  }	 t i d t
 | |	   t i | |	  t } qn | oE t i d | | t
 |  f  t d d d g | | | g  n d  S(   Ns   -rs    (to revision %s)RK   s   .svni    s/   Checkout in %s exists, and has correct URL (%s)s   Updating checkout %s%sRX  R  s%   svn checkout in %s exists with URL %ss,   The plan is to install the svn repository %ss2   What to do?  (s)witch, (i)gnore, (w)ipe, (b)ackup Rx  R  R   t   bs   Switching checkout %s to %s%st   switchs   Deleting %ss   Backing up %s to %ss   Checking out %s%s to %sR  s   -q(   Rx  R  R   R  (   R  Rk   R-   R.   R0   R/   RM  R   R(   Ru   R   R   R  R)   t   askR  R
  R   R  (
   R   R;   Re  R  t   rev_optionst   rev_displayR  t   existing_urlt   responseR  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  	  sX    "					
		c         C   s   t  i d  } x | D] } t |  i } | p q n d | j o& d i | i d  d   i   } n | } | | i j o | i d d  d Sq Wd  S(   Ns
   #egg=(.*)$R   iR   i   i    (	   R   R  R^  R  R/   R/  R  R   R1   (   R   R   R   t   egg_fragment_reRe  R  R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  
  s     &c         C   s]  d } xPt  i |  D]?\ } } } d | j o g  | (q n | i d  t  i i | d d  } t  i i |  p q n t |  } | i   } | i   | i	 d  p | i	 d  o t
 t i | i d   } | d d =| d d }	 g  }
 | D]9 } t |  d j o  | d o |
 t | d  q q ~
 d g } | o t |  } qd } n | i	 d	  oy t i |  i d
  }	 g  } t i |  D] } | t | i d
   q~ d g } | o t |  } qd } n t i d |  g  | (q | | j o |	 d } n |	 i	 |  p g  | (q n t | |  } q W| S(   sR   
        Return the maximum revision for all files under a given location
        i    s   .svnt   entriest   8t   9s   

i   i	   s   <?xmli   s-   Unrecognized .svn/entries format; skipping %sR   (   R-   R  R  R.   R/   R0   R   R   Rw   R   t   mapRJ   R  R/  R   R(  t   maxt   _svn_xml_url_reR   R  t   _svn_rev_reRz  R(   R)   (   R   R2   t   revisionRT  R  R  t
   entries_fnR   R  t   dirurlR#   t   dt   revst   localrevRo  t   mt   base_url(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   get_revision
  sJ     
 T
@
c         C   sS  | } xb t  i i t  i i | d   p? | } t  i i |  } | | j o t i d |  d  Sq	 Wt t  i i | d d   } | i	   } | i
   | i d  p | i d  o3 t t i | i d   } | d d =| d d	 S| i d
  o8 t i |  } | p t d |   n | i d  St i d |  d  Sd  S(   Ns   setup.pysG   Could not find setup.py for directory %s (tried all parent directories)s   .svnR  R  R  s   

i    i   s   <?xmls   Badly formatted data: %ri   s&   Unrecognized .svn/entries format in %s(   R-   R.   R0   R/   R"   R(   R)   R1   R   R   Rw   R   R  RJ   R  R/  R  R   R  R  (   R   R2   t   orig_locationt   last_locationR   R  R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   get_urlD
  s.     "	

 c         C   s   t  d d d | g d t } g  } xV | i   D]H } | i   } t | d  } | d i d  } | i | | f  q1 W| S(   NRX  t   lss   -vR  i    iR   (   R  R   R  R/  R(  R   Rh   (   R   t   svn_tag_urlRf   t   resultsR   RV  R  t   tag(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   get_tag_revsa
  s     c         C   s^   d  } d  } xK | D]C \ } } | | j o* | d  j p | | j o | } | } q q W| S(   N(   R1   (   R   R  t   tag_revst   best_match_revt   best_tagR  t   tag_rev(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   find_tag_matchl
  s     c         C   s  |  i  |  } | d  j o d  S| i d  } | i   i d d  d } | d d j o d | | | d	 f S| d d j o1 |  i |  } d | | | i   | d	 | f S| d	 d j o |  i |  } | oi d i | d	   d } |  i |  }	 |  i | |	  }
 |
 o& t i	 d |
  d | |
 | |
 f Sn d | | | i   f St i
 d |  |  i |  } d | | | f Sd  S(   NR   R   i   i    it   tagsR  s   svn+%s#egg=%s-%sit   branchest   branchs   svn+%s@%s#egg=%s%s-r%st   trunks   /tagss2   trunk checkout %s seems to be equivalent to tag %ss   svn+%s/%s#egg=%s-%ss   svn+%s@%s#egg=%s-devs?   svn URL does not fit normal structure (tags/branches/trunk): %s(   s   tagss   tag(   s   branchess   branch(   R  R1   R/  R  R  R/   R  R  R(   R   R)   (   R   R   R2   R   t   repoRV  t   egg_project_nameR  t   tag_urlR  R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  x
  s.    "(   s   svns   svn+ssh(   R   R   R&   R"   R   R  RN  RM  R  R  R  R  R  R  R  R  R   R  (    (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR@  	  s   				1		0			t   Gitc           B   s   e  Z d  Z d Z d Z d Z d Z d   Z d   Z d   Z	 d	   Z
 d
   Z d   Z d   Z d   Z d   Z d   Z RS(   R   s   .gits   git+https   git+sshs   git-clone.txtss   # This was a Git repo; to make it a repo again run:
git init
git remote add origin %(url)s -f
git checkout %(rev)s
c         C   sD   | i  d  i d  p t d |  |  i |  |  i |  f S(   s/   Returns (url, revision), where both are stringsR   s   .gits   Bad directory: %s(   R!  R   RQ   R  R  (   R   R2   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRM  
  s    (c         C   s   d  } } x | i   D] } | i   p | i   i d  o q n t i d |  } | o | i d  i   } n t i d |  } | o | i d  i   } n | o | o | | f Sq Wd S(   NR   s$   git\s*remote\s*add\s*origin(.*)\s*-fi   s   ^git\s*checkout\s*-q\s*(.*)\s*(   NN(   R1   R  R   R   R   R   R  (   R   R   Re  R  R   t	   url_matcht	   rev_match(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   parse_clone_text
  s    
 $c      	   C   s   |  i    \ } } t i d | | f  t i d 7_ zM t i i |  o t i |  n t t	 d | | g d |  i
 d t Wd t i d 8_ Xd S(   s?   Clone the Git repository at the url to the destination locations   Cloning Git repository %s to %si   t   cloneR  R  N(   R  R(   R   R   R-   R.   R0   R  R  t   GIT_CMDR  R   (   R   R2   Re  R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  
  s    c   
      C   s  |  i    \ } } | o | g } d | } n d g } d } t } t i i t i i | d   o|  i |  } t } | | j ow t i	 d t
 |  | f  t i d t
 |  | f  t t d d g d	 | t t d
 d d g | d	 | qGt i d t
 |  | f  t i d |  t d d  } | d j o] t i d t
 |  | | f  t t d d | g d	 | t t d
 d g | d	 | qG| d j o qG| d j o. t i d t
 |   t i |  t } qG| d j oC t |  }	 t i d t
 |  |	 f  t i | |	  t } qGn | oZ t i d | | t
 |  f  t t d d | | g  t t d
 d g | d	 | n d  S(   Ns    (to revision %s)t   masterRK   s   .gits,   Clone in %s exists, and has correct URL (%s)s   Updating clone %s%st   fetchs   -qR  R  s   -fs"   Git clone in %s exists with URL %ss,   The plan is to install the Git repository %ss2   What to do?  (s)witch, (i)gnore, (w)ipe, (b)ackup Rx  R  R   R  s   Switching clone %s to %s%st   configs   remote.origin.urls   Deleting %ss   Backing up %s to %ss   Cloning %s%s to %sR  (   Rx  R  R   R  (   R  Rk   R-   R.   R0   R/   R  R   R(   Ru   R   R   R  R  R)   R  R  R
  R   R  (
   R   R;   Re  R  R  R  R  R  R  R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  
  s^    		"		!			
 c         C   s+   t  t d d g d t d | } | i   S(   NR  s   remote.origin.urlR  R  (   R  R  R   R   (   R   R2   Re  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  
  s    c         C   s+   t  t d d g d t d | } | i   S(   Ns	   rev-parseRj  R  R  (   R  R  R   R   (   R   R2   t   current_rev(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  
  s    c         C   s+   t  t d d g d t d | } | i   S(   Ns	   rev-parseR  R  R  (   R  R  R   R   (   R   R2   t
   master_rev(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   get_master_revision  s    c         C   s   t  t d g d t d | } g  } xZ | i   D]L } | i   } t  t d | g d t d | } | i | i   | f  q1 Wt |  } | S(   NR  R  R  s	   rev-parse(   R  R  R   R  R   Rh   RG  (   R   R2   R  R  R   R  R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s     c   	   	   C   s   t  t d d g d t d | } g  } x | i   D] } d i g  } | i   D] } | d j o | | qQ qQ ~  } t  t d | g d t d | } | i | i   | f  q4 Wt |  } | S(   NR  s   -rR  R  RK   R   s	   rev-parse(	   R  R  R   R  R/   R/  Rh   R   RG  (	   R   R2   R  t   branch_revsR   R#   R  R  R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   get_branch_revs  s     Ac         C   s  |  i  |  } | i   i d  p d | } n | i   i d d  d } | p d  S|  i |  } |  i |  } |  i |  } |  i	 |  }	 | | j o' | i
 | |  }
 d | |
 | |
 f S| |	 j o- |	 i
 | |  } d | | | i   | f S| | j on | oO | | j o> | i
 | |  }
 t i d | |
 f  d | |
 | |
 f Sn d | | | i   f St i d	 |  d | | | f Sd  S(
   Ns   git:s   git+R   i   i    s   %s@%s#egg=%s-%ss,   Revision %s seems to be equivalent to tag %ss   %s@%s#egg=%s-devs)   Git URL does not fit normal structure: %s(   R  R  R   R  R/  R1   R  R  R  R  Rj   R(   R   R)   (   R   R   R2   R   R  R  R  R  R  R  R  R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s2    (   s   gits   git+https   git+ssh(   R   R   R&   R"   R   R  RN  RM  R  R  R  R  R  R  R  R  R  (    (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  
  s   				4					t	   Mercurialc           B   s   e  Z d  Z d Z d Z d Z d Z d   Z d   Z d   Z	 d	   Z
 d
   Z d   Z d   Z d   Z d   Z d   Z RS(   R   s   .hgs   hg+https   hg+sshs   hg-clone.txtsg   # This was a Mercurial repo; to make it a repo again run:
hg init
hg pull %(url)s
hg update -r %(rev)s
c         C   sD   | i  d  i d  p t d |  |  i |  |  i |  f S(   s/   Returns (url, revision), where both are stringsR   s   .hgs   Bad directory: %s(   R!  R   RQ   R  R  (   R   R2   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRM  K  s    (c         C   s   d  } } x | i   D] } | i   p | i   i d  o q n t i d |  } | o | i d  i   } n t i d |  } | o | i d  i   } n | o | o | | f Sq Wd S(   NR   s   hg\s*pull\s*(.*)\s*i   s   ^hg\s*update\s*-r\s*(.*)\s*(   NN(   R1   R  R   R   R   R   R  (   R   R   Re  R  R   R  R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  P  s    
 $c      	   C   s   |  i    \ } } t i d | | f  t i d 7_ zM t i i |  o t i |  n t d d | | g d |  i	 d t
 Wd t i d 8_ Xd S(   s>   Clone the Hg repository at the url to the destination locations%   Cloning Mercurial repository %s to %si   R   R  R  R  N(   R  R(   R   R   R-   R.   R0   R  R  R  R   (   R   R2   Re  R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  _  s    c      	   C   s-  |  i    \ } } | o | g } d | } n d g } d } t } t i i t i i | d   oa|  i |  } t } | | j ot t i	 d t
 |  | f  t i d t
 |  | f  t d d d	 g d
 | t d d d	 g | d
 | qt i d t
 |  | f  t i d |  t d d  } | d j o t i d t
 |  | | f  t i i | d  }	 t i   }
 yI t |	 d  } |
 i |  |
 i d d i |  |  |
 i |  Wn3 t t i f j
 o t i d | t f  qXt d d d	 g | d
 | q| d j o q| d j o. t i d t
 |   t i |  t } q| d j oC t |  } t i d t
 |  | f  t i | |  t } qn | oZ t i d | | t
 |  f  t d d d	 | | g  t d d d	 g | d
 | n d  S(   Ns    (to revision %s)RD   RK   s   .hgs,   Clone in %s exists, and has correct URL (%s)s   Updating clone %s%sR   R  s   -qR  R  s(   Mercurial clone in %s exists with URL %ss2   The plan is to install the Mercurial repository %ss2   What to do?  (s)witch, (i)gnore, (w)ipe, (b)ackup Rx  R  R   R  s   Switching clone %s to %s%ss   .hg/hgrcR   R   s/   Could not switch Mercurial repository to %s: %ss   Deleting %ss   Backing up %s to %ss   Cloning hg %s%s to %sR  (   Rx  R  R   R  (   R  Rk   R-   R.   R0   R/   R  R   R(   Ru   R   R   R  R)   R  t   ConfigParsert   SafeConfigParserR   t   readfpR   Rx   t   OSErrort   NoSectionErrorR   R  R
  R   R  (   R   R;   Re  R  R  R  R  R  R  t   repo_configR  t   config_fileR  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  m  sn    		"					
	c         C   s+   t  d d d g d t d | } | i   S(   NR   t
   showconfigs   paths.defaultR  R  (   R  R   R   (   R   R2   Re  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s    c         C   s+   t  d d d g d t d | } | i   S(   NR   t   tips   --template={rev}R  R  (   R  R   R   (   R   R2   R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   get_tip_revision  s    c         C   s   t  d d g d t d | } g  } xn | i   D]` } t i d |  } | oA | i d  } | i d  } | i | i   | i   f  q1 q1 Wt |  S(   NR   R  R  R  s   ([\w-]+)\s*([\d]+):.*$i   i   (	   R  R   R  R   R   R  Rh   R   RG  (   R   R2   R  R  R   t
   tags_matchR  R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s     'c         C   s   t  d d g d t d | } g  } xn | i   D]` } t i d |  } | oA | i d  } | i d  } | i | i   | i   f  q1 q1 Wt |  S(   NR   R  R  R  s   ([\w-]+)\s*([\d]+):.*$i   i   (	   R  R   R  R   R   R  Rh   R   RG  (   R   R2   R  R  R   t   branches_matchR  R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s     'c         C   sg   t  d d g d t d | i   } |  i |  } x$ | D] } | | | j o | Sq: W|  i |  S(   NR   R  R  R  (   R  R   R   R  R  (   R   R2   t   current_branchR  R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s    ! 	c         C   s  |  i  |  } | i   i d  p d | } n | i   i d d  d } | p d  S|  i |  } |  i |  } |  i |  } |  i	 |  }	 | | j o' | i
 | |  }
 d | |
 | |
 f S| | j o- | i
 | |  } d | | | i   | f S| |	 j on | oO | | j o> | i
 | |  }
 t i d | |
 f  d | |
 | |
 f Sn d | |	 | i   f St i d	 |  d | | | f Sd  S(
   Ns   hg:s   hg+R   i   i    s   %s@%s#egg=%s-%ss,   Revision %s seems to be equivalent to tag %ss   %s@%s#egg=%s-devs/   Mercurial URL does not fit normal structure: %s(   R  R  R   R  R/  R1   R  R  R  R  Rj   R(   R   R)   (   R   R   R2   R   R  R  R  R  R  t   tip_revR  R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s2    (   s   hgs   hg+https   hg+ssh(   R   R   R&   R"   R   R  RN  RM  R  R  R  R  R  R  R  R  R  (    (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  C  s   				=						t   Bazaarc           B   sw   e  Z d  Z d Z d Z d Z d Z d   Z d	   Z d
   Z	 d   Z
 d   Z d   Z d   Z d   Z d   Z RS(   R   s   .bzrs   bzr-branch.txts   bzr+https	   bzr+httpss   bzr+sshs   bzr+sftps[   # This was a Bazaar branch; to make it a branch again run:
bzr branch -r %(rev)s %(url)s .
c         C   sD   | i  d  i d  p t d |  |  i |  |  i |  f S(   s/   Returns (url, revision), where both are stringsR   s   .bzrs   Bad directory: %s(   R!  R   RQ   R  R  (   R   R2   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRM     s    (c         C   s   d  } } x | i   D] } | i   p | i   i d  o q n t i d |  } | o | i d  i   } n | | i   i   i d  d  d } | o | o | | f Sq Wd S(   NR   s   ^bzr\s*branch\s*-r\s*(\d*)i   i    (   NN(	   R1   R  R   R   R   R   R  R  R/  (   R   R   Re  R  R   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s    
 $&c      	   C   s   |  i    \ } } t i d | | f  t i d 7_ zM t i i |  o t i |  n t d d | | g d |  i	 d t
 Wd t i d 8_ Xd S(   s9   Get the bzr branch at the url to the destination locations$   Checking out bzr repository %s to %si   R   R  R  R  N(   R  R(   R   R   R-   R.   R0   R  R  R  R   (   R   R2   Re  R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s    c         C   s  |  i    \ } } | o d | g } d | } n g  } d } t } t } t i i t i i | d   o|  i |  } t } | | j oH t i	 d t
 |  | f  t i d t
 |  | f  t } } qt i d t
 |  | f  t i d |  t d	 d  }	 |	 d
 j o= t i d t
 |  | | f  t d d | g d | q|	 d j o q|	 d j o. t i d t
 |   t i |  t } q|	 d j oC t |  }
 t i d t
 |  |
 f  t i | |
  t } qn | o t i d | | t
 |  f  | i d  o d | } n | o( t d d d g | | g d | qt d d d g | | | g  n d  S(   Ns   -rs    (to revision %s)RK   s   .bzrs/   Checkout in %s exists, and has correct URL (%s)s   Updating branch %s%ss&   Bazaar branch in %s exists with URL %ss/   The plan is to install the Bazaar repository %ss2   What to do?  (s)witch, (i)gnore, (w)ipe, (b)ackup Rx  R  R   R  s   Switching branch %s to %s%sR   R  R  s   Deleting %ss   Backing up %s to %ss   Checking out %s%s to %ss   ssh://s   bzr+t   pulls   -qR  (   Rx  R  R   R  (   R  Rk   R   R-   R.   R0   R/   R  R(   Ru   R   R   R)   R  R  R  R
  R   R  R   (   R   R;   Re  R  R  R  R  R  R  R  R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s^    "					
	%c         C   sx   t  d d g d t d | } xS | i   D]E } | i   } x0 d	 D]( } | i |  o | i |  d SqD Wq+ Wd  S(
   NR   Ru   R  R  s   checkout of branch: s   repository branch: s   parent branch: i   (   s   checkout of branch: s   repository branch: s   parent branch: (   R  R   R  R   R   R/  R1   (   R   R2   R  R   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  W  s       c         C   s(   t  d d g d t d | } | i   S(   NR   t   revnoR  R  (   R  R   R   (   R   R2   R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  c  s    c         C   s:   |  i  |  } t d d | g d t d | } | i   S(   NR   R  R  R  (   R  R  R   R   (   R   R2   Re  R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   get_newest_revisionh  s    c         C   s   t  d d g d t d | } g  } xn | i   D]` } t i d |  } | oA | i d  } | i d  } | i | i   | i   f  q1 q1 Wt |  S(   NR   R  R  R  s   ([.\w-]+)\s*(.*)$i   i   (	   R  R   R  R   R   R  Rh   R   RG  (   R   R2   R  R  R   R  R  R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  n  s     'c   
      C   s]  |  i  |  } | i   i d  p d | } n | i   i d d  d } | p d  S|  i |  } |  i |  } |  i |  } | | j o' | i	 | |  }	 d | |	 | |	 f S| | j on | oO | | j o> | i	 | |  }	 t
 i d | |	 f  d | |	 | |	 f Sn d | | | i   f St
 i d	 |  d | | | f Sd  S(
   Ns   bzr:s   bzr+R   i   i    s   %s@%s#egg=%s-%ss,   Revision %s seems to be equivalent to tag %ss   %s@%s#egg=%s-devs,   Bazaar URL does not fit normal structure: %s(   R  R  R   R  R/  R1   R  R  R  Rj   R(   R   R)   (
   R   R   R2   R   R  R  R  R  t
   newest_revR  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  z  s*    (   s   bzrs   bzr+https	   bzr+httpss   bzr+sshs   bzr+sftp(   R   R   R&   R"   R  R   RN  RM  R  R  R  R  R  R  R  R  (    (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s   				7				c         C   sH   t  i |  } | o |   i |  | |  St i d |  |  i   S(   Nst   cannot determine version of editable source in %s (is not SVN checkout, Git clone, Mercurial clone or Bazaar branch)(   R  R6   R  R(   R)   R  (   R   R2   R   R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s
    s   ^(http|https|file):s   /*([a-z])\|c         C   st  t  i |   } | o2| i d  i   } | d j o1 | o* | i d  o t d | |  f   n | d j o |  i d d  d } | i d d  } t i	 |  } | o+ | i d  d | i d d  d } n t
 i |  } | i d  o d | i d  } n | }  qHt i |   } | i   | i   f Sn t |   } | i   } | i   |  | f S(	   sk   Gets the content of a file; it may be a filename, file: URL, or
    http: URL.  Returns (location, content)i   RC  R:  s6   Requirements file %s references URL %s, which is localR.  s   \R   t   |(   t
   _scheme_reR   R  R  R   R   R/  R"  t	   _drive_reR   R1  t   unquoteR   R<  R$  R^  R   R   Rw   (   Re  R  R   R  R.   R6  R   R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   get_file_content  s0    +

c   
      c   s  d  } t i i d  o t i t i d  } n t |  d | \ }  } xt | i    D]x\ } } | d 7} | i	   } | p | i
 d  o q^ n | o | i |  o q^ n | i
 d  p | i
 d  o | i
 d  o | d i	   } n  | t d  i	   i	 d  } t i |   o t i |  t  } n6 t i |  p% t i i t i i |   |  } n xXt | | d |  D] } | VqWq^ | i
 d	  p | i
 d
  o q^ | i
 d  p | i
 d  oW | i
 d  o | d i	   } n  | t d  i	   i d  } | i i |  q^ d |  | f } | i
 d  p | i
 d  oP | i
 d  o | d i	   } n | t d  i	   } t i | |  }	 n t i | |  }	 |	 Vq^ Wd  S(   Nt   PIP_SKIP_REQUIREMENTS_REGEXR  i   R   s   -rs   --requirementi   R   s   -Zs   --always-unzips   -fs   --find-linkss   -r %s (line %s)s   -es
   --editable(   R1   R-   Ri   Rj   R   R  R  t	   enumerateR  R   R   R   R   R  R   R|  Re  R.   R/   R"   R   R   R   Rh   R   R   R   (
   R   R   R  t
   skip_matchR  t   line_numberR   t   req_urlt   itemR   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     sN     
 %    Rd   c           B   s  e  Z d  Z e i d Z e i Z e i Z e i e i d Z e i Z Z	 e i
 Z
 e i Z e e e e e e
 e g Z d   Z d   Z d   Z d   Z d   Z d   Z d	   Z d
   Z d   Z d d  Z d d  Z d   Z d   Z d   Z e d    Z d   Z RS(   s   
    Logging object for use in command-line script.  Allows ranges of
    levels, to avoid some redundancy of displayed information.
    i   i   c         C   s1   | |  _  d |  _ t |  _ d  |  _ t |  _ d  S(   Ni    (   Ro   R   R   Rl   R1   t   in_progresst   in_progress_hanging(   R   Ro   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s
    				c         O   s   |  i  |  i | | |  d  S(   N(   RF   Rg   (   R   t   msgRz   t   kw(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s    c         O   s   |  i  |  i | | |  d  S(   N(   RF   R  (   R   R  Rz   R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRu     s    c         O   s   |  i  |  i | | |  d  S(   N(   RF   R  (   R   R  Rz   R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s    c         O   s   |  i  |  i | | |  d  S(   N(   RF   t   WARN(   R   R  Rz   R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR)     s    c         O   s   |  i  |  i | | |  d  S(   N(   RF   R  (   R   R  Rz   R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR*    s    c         O   s   |  i  |  i | | |  d  S(   N(   RF   t   FATAL(   R   R  Rz   R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRt     s    c         O   sA  | o | o t  d   q" n | p | } d  } x|  i D] \ } } |  i | |  o |  i oC | t i t i f j o* t |  _ t i i	 d  t i i
   n | d  j oN | o | | } n | } d |  i | } |  i o d | | f } qn t | d  o | i	 | d  q9| |  q? q? Wd  S(   Ns6   You may give positional or keyword arguments, not boths   
R  s   %02i %sRx   (   t	   TypeErrorR1   Ro   t   level_matchesR  RT   Rf   t   stderrR   Rx   t   flushR   Rl   R'   (   R   R|   R  Rz   R  t   renderedt   consumer_levelt   consumer(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRF     s0    
 
	
c         C   s   |  i  p t d | |  i  f  |  i |  i |  i    o5 t i i d |  i |  t i i	   t
 |  _ n
 t |  _ | |  _  d  |  _ d  S(   Ns0   Tried to start_progress(%r) while in_progress %rR  (   R  RQ   R  R  t   _stdout_levelRT   Rf   Rx   R   R  Rk   R  R   R1   t   last_message(   R   R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR*  6  s    		s   done.c         C   s   |  i  p
 t d  |  i |  i  oy |  i p0 t i i d |  i  | d  t i i   q t	 i
 d  t	 i
 d  t i i | d  t i i   n d  |  _  t |  _ d  S(   Ns,   Tried to end_progress without start_progresss   ...s   
RK   (   R  RQ   t   stdout_level_matchesR  R  RT   Rf   Rx   R  R(   R,  R1   R   (   R   R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR-  C  s    
	c         C   s   |  i  o | d j o! t i i d  t i i   q |  i o* d t d t |  i  t |   } n d } t i i d d |  i	 |  i
 | | f  t i i   | |  _ n d S(   sa   If we are in a progress scope, and no log messages have been
        shown, write out another '.'t   .R  i    RK   s	   %s%s%s%sN(   R  R1   RT   Rf   Rx   R  R  R  R   R   R  (   R   t   messaget   padding(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR,  T  s    

**c         C   s   |  i  | |  i    S(   s9   Returns true if a message at this level will go to stdout(   R  R  (   R   R|   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  d  s    c         C   s6   x, |  i  D]! \ } } | t i j o | Sq
 W|  i S(   s%   Returns the level that stdout runs at(   Ro   RT   Rf   R  (   R   R|   R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  h  s
    
 	c         C   st   t  | t  oV | i | i } } | d j	 o | | j o t S| d j	 p | | j o t St S| | j Sd S(   sm  
        >>> l = Logger()
        >>> l.level_matches(3, 4)
        False
        >>> l.level_matches(3, 2)
        True
        >>> l.level_matches(slice(None, 3), 3)
        False
        >>> l.level_matches(slice(None, 3), 2)
        True
        >>> l.level_matches(slice(1, 3), 1)
        True
        >>> l.level_matches(slice(2, 3), 1)
        False
        N(   R  t   sliceR  t   stopR1   R   Rk   (   R   R|   R  R  R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  o  s    c         C   sC   |  i  } | d j  o	 | d S| t |  j o	 | d S| | S(   Ni    i(   t   LEVELSR   (   R*   R|   t   levels(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRe     s    			c         C   s   g  } g  } xT |  i  D]I \ } } | t i j o- | i | | f  | i | t i f  q q Wx | D] } |  i  i |  qj W|  i  i |  d  S(   N(   Ro   RT   Rf   Rh   R  R  R   (   R   t	   to_removet   to_addR  R  R
  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR     s    
  N(   R   R   R   t   loggingRg   R  R  R  R  t   WARNINGt   ERRORR  R   R   R   Ru   R   R)   R*  Rt   RF   R*  R-  R1   R,  R  R  R  R  Re   R   (    (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRd     s2   																	c         C   s  | d  j o g  } xi |  D]a }	 d |	 j p' d |	 j p d |	 j p d |	 j o d |	 i d d  }	 n | i |	  q Wd i |  } n | o
 d  }
 n
 t i }
 t i | d |  t i	 i
   } | o | i |  n y4 t i |  d t i d	 d  d
 |
 d | d | } Wn/ t j
 o# } t i d | | f    n Xg  } |
 d  j	 o | i }
 x |
 i   } | p Pn | i   } | i | d  | o^ | |  } t | t  o | \ } } n t i | |  t i |  p t i   qqlt i |  qln# | i   \ } } | p d g } | i   | i ox | oS | o/ t i d |  t i d i |  d  n t d | | i f   qt i d | | i f  n |
 d  j	 o d i |  Sd  S(   NR  s   
t   "t   's   "%s"s   \"s   Running command %sR  t   stdinRf   R  t   envs#   Error %s while executing command %sRK   s    Complete output from command %s:s)   
----------------------------------------s$   Command %s failed with error code %ss   Command %s had error code %s(   R1   R"  Rh   R/   t
   subprocesst   PIPER(   RF   R-   Ri   t   copyR  t   Popent   STDOUTt	   ExceptionRt   Rf   t   readlineR!  R  t   tupleR  R,  Ru   t   communicatet   waitt
   returncodeR   R   R)   (   t   cmdR  R  R  t   raise_on_returncodeR  R  R  t	   cmd_partst   partRf   R*  t   procR   t
   all_outputR   R|   t   returned_stdoutt   returned_stderr(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    sp     4
		

c         C   s)   t  i d |   o t  i d |  t  i  S(   sJ   Returns true if the page appears to be the index page of an svn repositorys   <title>[^<]*Revision \d+:s#   Powered by (?:<a[^>]*?>)?Subversion(   R   R   R  (   t   html(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR>    s    c         C   s/   t  |  d  } z | i   SWd  | i   Xd  S(   NR  (   R   R   Rw   (   R   R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR?    s    c         C   s   t  |   }  |  i d  i d  }  d |  j oJ d |  j o |  i d  |  i d  j  p d |  j o |  i d d  Sd |  j o |  i d d  S|  d f Sd  S(   NR   s   \i   RK   (   RJ   R   t   findR/  (   R.   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRB    s    9c         C   sb   d } xU |  D]M } t |  \ } } | p t S| d j o
 | } q | | j o t Sq Wt S(   sy   Returns true if all the paths have the same leading path name
    (i.e., everything is in one subdirectory in an archive)N(   R1   RB  R   Rk   (   R   t   common_prefixR.   R  R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRA    s     
	c         C   s^   |  d j o d |  d d S|  d	 j o d |  d S|  d j o d |  d Sd |  Sd  S(
   Ni  s   %.1fMbg     @@i
   s   %iKbs   %.1fKbs   %ibytesi@B i'  (    (   t   bytes(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR+    s    s   [^a-z]c         C   s   t  i d |  i    S(   NR   (   t   _normalize_reR  R  (   R&   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s    c         C   s=  t  i i |   } t  i i |   }  t  i i t  i i |    }  t  i i t  i i |   } |  i t  i i  i t  i i  } | i t  i i  i t  i i  } xB | o: | o3 | d | d j o | i	 d  | i	 d  q Wd g t
 |  | | g } | d g j o d t  i i St  i i i |  S(   s  
    Make a filename relative, where the filename path, and it is
    relative to rel_to

        >>> make_relative_path('/usr/share/something/a-file.pth',
        ...                    '/usr/share/another-place/src/Directory')
        '../../../something/a-file.pth'
        >>> make_relative_path('/usr/share/something/a-file.pth',
        ...                    '/home/user/src/Directory')
        '../../../usr/share/something/a-file.pth'
        >>> make_relative_path('/usr/share/a-file.pth', '/usr/share/')
        'a-file.pth'
    i    s   ..RK   R  (   R-   R.   R   R"   t   normpathR   R   R	  R/  R  R   R/   (   R.   t   rel_tot   path_filenamet
   path_partst   rel_to_partst
   full_parts(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s    $$ #c         C   s`   t  i i t  i i |    }  |  i t  i   t  i i  o d |  t t  i    }  n |  S(   sT   Gives the display value for a given path, making it relative to cwd
    if possible.R  (   R-   R.   R   R   R   t   getcwdR	  R   (   R.   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR   2  s     c   	   	   C   s<  |  } t  i i |  o2 t  i i t  i i | d   o t |  } n | i   i d  o d | f Sx< t	 D]4 } | i   i d |  o d | | f } qs qs Wd | j o- t
 o t
 d | } q t d |    n | i d d  d i   } t	 i |  p t d	 |    n t i d
 |   } | p | i d  o t	 i |  o g  } |  i d d  d i d  D] } | o | | qq~ } | d d j o | d } q| d d j o | d } qt d |    n | i d  } t i d |  } | o | i d  } n | | f S(   sS   Parses svn+http://blahblah@rev#egg=Foobar into a requirement
    (Foobar) and a URLs   setup.pys   file:s   %s:s   %s+%sR  sJ   --editable=%s should be formatted with svn+URL, git+URL, hg+URL or bzr+URLi   i    ss   For --editable=%s only svn (svn+URL), Git (git+URL), Mercurial (hg+URL) and Bazaar (bzr+URL) is currently supporteds   (?:#|#.*?&)egg=([^&]*)R   R   iR  R  R  R  iiR  s@   --editable=%s is not the right format; it must have #egg=Packages   ^(.*?)(?:-dev|-\d.*)N(   s   tagss   branchess   tags   branch(   R-   R.   R   R0   R/   R  R  R   R1   R  t   default_vcsR   R/  R5   R   R   R  (	   R  Re  R  R3   R   R#   R  RV  R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  :  sB    5 )Es   .bakc         C   sM   d } | } x6 t  i i |  |  o | d 7} | t |  } q W|  | S(   s\   Figure out the name of a directory to back up the given dir to
    (adding .bak, .bak2, etc)i   (   R-   R.   R0   RJ   (   R  R'  t   nt	   extension(    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR   d  s     
c         C   sU   xN t  |   } | i   i   } | | j o d | d i |  f GHq | Sq d S(   s@   Ask the message interactively, with the given possible responsess<   Your response (%r) was not one of the expected responses: %ss   , N(   t	   raw_inputR   R  R/   (   R  R^   R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR  n  s    c         C   sb   t  i i |   } t |  d  } | o6 | d d IJ| d t i d t i d  f IJn | S(   s   Open the named log file in append mode.

    If the file already exists, a separator will also be printed to
    the file to separate past activity from current activity.
    t   aR   i<   s   %s run on %si    s   %c(   R-   R.   R0   R   RT   RU   t   timet   strftime(   R   R0   R~   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRn   y  s    (c         C   s8   d |  j o t  S|  i d d  d i   } | d j S(	   s)   Returns true if the name looks like a URLR.  i   i    R:  Rh  RC  R;  (   s   https   httpss   files   ftp(   R   R/  R  (   R&   R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s    c         C   s^   t  |   d i   d	 j o t i i |   o t St i i |  j o d |  j o t St S(
   Ni   s   .zips   .tar.gzs   .tar.bz2s   .tgzs   .tars	   .pybundleR   (   s   .zips   .tar.gzs   .tar.bz2s   .tgzs   .tars	   .pybundle(   R#  R  R-   R.   R0   Rk   R	  R   (   R&   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s     s	   ^([a-z]):s   ^([a-z])[|]c         C   s   t  i i t  i i |    }  t i |   } t i |  o | d d | d } n | i t  i i	 d  } | i
 d  } d | S(   sI   
    Convert a path to a file: URL.  The path will be made absolute.
    i    R   i   R   s   file:///(   R-   R.   R   R   R1  R2  R  R   R"  R	  R   (   R   Re  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s    c         C   s~   |  i  d  p t d |   |  t d  i d  } t i |  } t i |  o | d d | d } n d | } | S(   s(   
    Convert a file: URL to a path.
    s   file:s4   You can only turn file: urls into filenames (not %r)R   i    R.  i   (   R   RQ   R   R   R1  R  t   _url_drive_reR   (   Re  R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s    
c         C   s=   t  |   } | i } | p t | i  d } n t |  S(   sP   Get a requirement from the URL, if possible.  This looks for #egg
    in the URLi    (   R^  R  R#  R   t   package_to_requirement(   Re  R   R  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   get_requirement_from_url  s
    	c         C   se   t  i d |   } | o" | i d  } | i d  } n |  } d } | o d | | f S| Sd S(   s)   Translate a name like Foo-1.2 to Foo==1.3s   ^(.*?)(-dev|-\d.*)i   i   RK   s   %s==%sN(   R   R   R  (   t   package_nameR   R&   R9   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRR    s    c         C   sQ   t  i |   \ } } | i   i d  o | d | } | d  } n | | f S(   s,   Like os.path.splitext, but take off .tar toos   .tari(   R_  R#  R  R   (   R.   RT  R'  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR#    s
    t   _Infc           B   s    e  Z d  Z d   Z d   Z RS(   s   I am bigger than everything!c         C   s   |  | j o d Sd S(   Ni    i   (    (   R   RN  (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   __cmp__  s    c         C   s   d S(   NRh  (    (   R   (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyR    s    (   R   R   R   RV  R  (    (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyRU    s   	t   __main__(   RT   R-   RR   R   R<  R1  R   R   R;  R  R+  R_  R   R  R   t   hashlibR    RN  t
   md5_modulet   newR   t   email.FeedParserR   RE  t	   cStringIOR   Rp   R   R   R  R  Rm  RO  R$  R  R0  R   R	   R\   R1   R.   R/   R  R   R   RI  R   t   default_timeoutRP  R  RJ  Ri   Rj   R  t   pip_distR2   R9   t   objectR   R  RS   R   RV   RX   t   disable_interspersed_argsRY   RO   R   R   R   R   R   R)  R   R9  Rr   Rv   Rm   R   R   R  R   R  RU  R^  R   R  R  R  R  R  R  R@  R+   R  R  R  R  R  R  R  R  R   Rd   Rk   Rg   R  R>  R?  RB  RA  R+  RB  R  R  R   R  R   R  Rn   R  R  RQ  R  R  RS  RR  R#  RU  Rh  R   R   (    (    (    s'   /usr/lib/python2.6/dist-packages/pip.pyt   <module>   sl  
:							
Qx[ K
	  ?@!	
6	@					
				*
													