

\c           @   s  d  d l  m Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l	 Z	 d  d l
 m Z d  d l m Z m Z d  d l m Z m Z m Z m Z d  d l m Z d  d l m Z d  d l m Z m Z m Z m Z m Z m Z m Z m  Z  m! Z! m" Z" m# Z# m$ Z$ m% Z% m& Z& m' Z' d  d	 l( m) Z) m* Z* m+ Z+ m, Z, m- Z- m. Z. m/ Z/ m0 Z0 d  d
 l1 m2 Z2 d  d l m3 Z3 d  d l4 m5 Z5 m6 Z6 m7 Z7 m8 Z8 m9 Z9 m: Z: m; Z; m< Z< m= Z= m> Z> d Z? d e@ f d     YZA d ZB d e@ f d     YZC d e@ f d     YZD d   ZE d   ZF e jG d e jH  ZI eJ eJ eJ d  ZK eJ d  ZL d e@ f d     YZM d e@ f d     YZN d e@ f d     YZO d S(    i(   t
   FeedParserN(   t   change_root(   t   bin_pyt   running_under_virtualenv(   t   InstallationErrort   UninstallationErrort   BestVersionAlreadyInstalledt   DistributionNotFound(   t   vcs(   t   logger(   t   display_patht   rmtreet   askt   ask_path_existst
   backup_dirt   is_installable_dirt   is_localt   dist_is_localt   dist_in_usersitet   dist_in_site_packagest   renamest   normalize_patht   egg_link_patht   make_path_relativet   call_subprocess(   t   urlparset   urllibt   uses_pycachet   ConfigParsert   string_typest	   HTTPErrort   get_python_versiont   b(   t   Link(   t   build_prefix(
   t   get_file_contentt   is_urlt   url_to_patht   path_to_urlt   is_archive_filet   unpack_vcs_linkt
   is_vcs_urlt   is_file_urlt   unpack_file_urlt   unpack_http_urls   pip-delete-this-directory.txtt   InstallRequirementc           B   s  e  Z d% e d% e e d   Z e d% d% d   Z e d% d   Z d   Z	 d   Z
 e 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 j d  Z d& d  Z e d    Z e d    Z d   Z e d  Z e d  Z  d   Z! d   Z" d   Z# d   Z$ d' d% d  Z% d   Z& d( d  Z' d   Z( d    Z) e d!    Z* d"   Z+ d#   Z, e d$    Z- RS()   c         C   s   d |  _  t | t  r9 t j j |  } | j  |  _  n  | |  _ | |  _ | |  _ | |  _	 | |  _
 | |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ | |  _ d  |  _ d  |  _ t |  _ d  S(   N(    (   t   extrast
   isinstanceR   t   pkg_resourcest   Requirementt   parset   reqt
   comes_fromt
   source_dirt   editablet   urlt   as_eggt   Nonet   _egg_info_patht   satisfied_byt   conflicts_witht   _temp_build_dirt
   _is_bundlet   updatet   install_succeededt   uninstalledt   Falset   use_user_site(   t   selfR3   R4   R5   R6   R7   R8   R?   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   __init__'   s&    															c   	   	   C   sy   t  | |  \ } } } | j d  r6 t |  } n d  } |  | | d | d t d | } | d  k	 ru | | _ n  | S(   Ns   file:R5   R6   R7   (   t   parse_editablet
   startswithR%   R9   t   TrueR.   (	   t   clst   editable_reqR4   t   default_vcst   nameR7   t   extras_overrideR5   t   res(    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   from_editableD   s    !c      	   C   s  d } | j   } d } t j j t j j |   } d } t |  rW t |  } n t j j |  r t j j	 | k s | j
 d  r t |  s t d |   n  t t |   } nF t |  rt j j |  s t j d |  n  t t |   } n  | rv| d k rv| j } | j } | j d k r|t j d |  r|t t j j t j j | j    } q|n | } |  | | d | S(   s   Creates an InstallRequirement from a name, which might be a
        requirement, directory containing 'setup.py', filename, or URL.
        t   .s;   Directory %r is not installable. File 'setup.py' not found.sA   Requirement %r looks like a filename, but the file does not existt   files   \.\./R7   N(   R9   t   stript   ost   patht   normpatht   abspathR$   R!   t   isdirt   sepRG   R   R   R&   R'   t   isfileR	   t   warnt   url_without_fragmentt   egg_fragmentt   schemet   ret   search(   RI   RL   R4   R7   R3   RT   t   link(    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt	   from_lineS   s,    3		!-c         C   s   |  j  r8 t |  j   } |  j rA | d |  j 7} qA n	 |  j } |  j d  k	 rm | d t |  j j  7} n  |  j r t |  j t	  r |  j } n |  j j
   } | r | d | 7} q n  | S(   Ns    from %ss    in %ss
    (from %s)(   R3   t   strR7   R;   R9   R
   t   locationR4   R/   R   t	   from_path(   RD   t   sR4   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   __str__x   s    				c         C   sv   |  j  d  k r d  St |  j   } |  j rr t |  j t  rI |  j } n |  j j   } | rr | d | 7} qr n  | S(   Ns   ->(   R3   R9   Rb   R4   R/   R   Rd   (   RD   Re   R4   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyRd      s    	c         C   s   |  j  d  k	 r |  j  S|  j d  k rJ t j d d  |  _  | |  _ |  j  S|  j re |  j j   } n	 |  j } t	 j
 j |  s t |  n  t	 j
 j | |  S(   Ns   -builds   pip-(   R=   R9   R3   t   tempfilet   mkdtempt   _ideal_build_dirR6   RL   t   lowerRS   RT   t   existst   _make_build_dirt   join(   RD   t	   build_dirt   unpackRL   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   build_location   s    			c         C   s8  |  j  d k	 r d S|  j d k	 s( t  |  j s7 t  |  j } |  j } |  ` |  j rj |  j j   } n	 |  j } t	 j
 j | |  } t	 j
 j |  s t j d |  t |  n  t	 j
 j |  r t d t |    n  t j d |  t |  t |  f  t j | |  | |  _ | |  _  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(   R5   R9   R3   t   AssertionErrorR=   Ri   R6   RL   Rj   RS   RT   Rm   Rk   R	   t   debugRl   R   R
   t   shutilt   moveR:   (   RD   t   old_locationt   new_build_dirRL   t   new_location(    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   correct_build_location   s0    							c         C   s   |  j  d  k r d  S|  j  j S(   N(   R3   R9   t   project_name(   RD   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyRL      s    c         C   s&   |  j  d  k r d  St j |  j  j  S(   N(   R3   R9   R   t   quotet   unsafe_name(   RD   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   url_name   s    c         C   s   t  j j |  j d  S(   Ns   setup.py(   RS   RT   Rm   R5   (   RD   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   setup_py   s    c         C   s  |  j  s t  |  j r/ t j d |  j  n t j d |  j  t j d 7_ z |  j } | j d t	 |  j
   } | j d t	 |  j   } |  j s | r g  } nF t j j |  j  d  } t j j |  s t j |  n  d d g } t t j d | d	 g | d
 |  j  d |  j d t d t j d d Wd  t j d 8_ X|  j st j j d |  j    |  _ |  j   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   -ct   egg_infot   cwdt   filter_stdoutt   show_stdoutt   command_levelt   command_descs   python setup.py egg_infos   %(Name)s==%(Version)s(   R5   Rq   RL   R	   t   notifyR7   t   indentt   _run_setup_pyt   replacet   reprR}   R6   RS   RT   Rm   Rk   t   makedirsR   t   syst
   executablet   _filter_installRB   t   VERBOSE_DEBUGR3   R0   R1   R2   t   pkg_infoRx   (   RD   t   force_root_egg_infot   scriptt   egg_base_optiont   egg_info_dir(    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   run_egg_info   s2    						sR  
__file__ = __SETUP_PY__
from setuptools.command import egg_info
import pkg_resources
import os
def replacement_run(self):
    self.mkpath(self.egg_info)
    installer = self.distribution.fetch_build_egg
    for ep in pkg_resources.iter_entry_points('egg_info.writers'):
        # require=False is the change we're making:
        writer = ep.load(require=False)
        if writer:
            writer(self, ep.name, os.path.join(self.egg_info,ep.name))
    self.find_sources()
egg_info.egg_info.run = replacement_run
exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))
c         C   s   |  j  d  k	 r5 |  j  j |  s% d  S|  j  j |  S|  j sD t  |  j |  } t j j	 |  si d  St
 | d  } | j   } | j   | S(   Nt   r(   R;   R9   t   has_metadatat   get_metadataR5   Rq   t   egg_info_pathRS   RT   Rk   t   opent   readt   close(   RD   t   filenamet   fpt   data(    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   egg_info_data  s    
c   	   	   C   s<  |  j  d  k r&|  j r$ |  j } n t j j |  j d  } t j |  } |  j rg  } xt j |  D]\ } } } x- t	 j
 D]" } | | k r | j |  q q Wx t |  D] } t j j t j j | | d d   s
t j j t j j | | d d   r| j |  n  | d k s2| d k r | j |  q q W| j g  | D] } t j j | |  ^ qS qj Wg  | D] } | j d  r| ^ q} n  | st d	 | | f   n  | st d	 | | f   t |  d
 k r| j d d    n  t j j | | d  |  _  n  t j j |  j  |  S(   Ns   pip-egg-infot   bint   pythont   Scriptss
   Python.exet   testt   testss	   .egg-infos$   No files/directories in %s (from %s)i   t   keyc         S   s8   |  j  t j j  t j j r3 |  j  t j j  p6 d S(   Ni    (   t   countRS   RT   RX   t   altsep(   t   x(    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   <lambda>:  s   i    (   R:   R9   R6   R5   RS   RT   Rm   t   listdirt   walkR   t   dirnamest   removet   listRk   t   extendt   endswithR   Rq   t   lent   sort(	   RD   R   t   baset	   filenamest   roott   dirst   filest   dirt   f(    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR     s6    		''	*+c         C   so   |  j  |  } | s g  Sg  } xI | j   D]; } | j   } | s, | j d  rZ q, n  | j |  q, W| S(   Nt   #(   R   t
   splitlinesRR   RG   t   append(   RD   R   R   t   resultt   line(    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   egg_info_lines@  s    c         C   s^   t    } |  j d  } | sA t j d t |  j d    n  | j | pP d  | j   S(   Ns   PKG-INFOs   No PKG-INFO file found in %st    (   R    R   R	   RZ   R
   R   t   feedR   (   RD   t   pR   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR   L  s    	#c         C   s   |  j  d  S(   Ns   dependency_links.txt(   R   (   RD   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   dependency_linksT  s    s	   \[(.*?)\]c         c   s   d  } xx |  j d  D]g } |  j j | j    } | rO | j d  } q n  | rx | | k rx t j d |  q n  | Vq Wd  S(   Ns   requires.txti   s   skipping extra %s(   R9   R   t   _requirements_section_ret   matchRj   t   groupR	   Rr   (   RD   R.   t   in_extraR   R   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   requirementsZ  s    c         c   s5   x. |  j  j D]  \ } } | d k r | Vq q Wd  S(   Ns   ==(   R3   t   specs(   RD   t	   qualifiert   version(    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   absolute_versionsg  s    c         C   s   |  j    d S(   NR   (   R   (   RD   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   installed_versionm  s    c         C   sk   |  j  s t  |  j } | |  j k rD t j d |  |  j f  n# t j d t |  j   | |  f  d  S(   Ns'   Requested %s, but installing version %ss;   Source in %s has version %s, which satisfies requirement %s(   R5   Rq   R   R3   R	   RZ   Rr   R
   (   RD   R   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   assert_source_matches_versionq  s    		c         C   s  |  j  s! t j d |  j  d  S|  j s0 t  |  j s? t  |  j  j d  rU d  Sd |  j  k sw t d |  j    |  j s d  S|  j  j d d  \ } } t	 j
 |  } | r | |  j   } | r | j |  j  q| j |  j  n d st d |  j  | 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(   R7   R	   t   infoR5   R6   Rq   RG   R?   t   splitR   t   get_backendt   obtaint   export(   RD   R   t   vc_typeR7   t   backendt   vcs_backend(    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   update_editablez  s(    	"		c         C   s  |  j    s% t d |  j f   n  |  j p4 |  j } t |  } t j j | j	 | j
    d } | j d t j d  } | j
   d } t |  } t j j |  } t j j |  }	 | s |	 r| r | }
 n | }
 | j |
  | j d  rLx| j d  j   D]4 } t j j t j j |
 |   } | j |  qWq | j d  r | j d  r|| j d  } n g  } x g  | j d  j   D] } | r| | k r| ^ qD]M } t j j | j	 |  } | j |  | j | d	  | j | d
  qWq n| j	 j |  rq| j | j	  t j j t j j | j	  d  } | j | d |  n | r t | d  } t j j | j   j    } | j   | | j	 k st d | |  j | j	 f   | j |  t j j t j j |  d  } | j | | j	  n  | j d  r| j d  rxh | j d  D]T } | j t j j t  |   t! j" d k rN| j t j j t  |  d  qNqNWn  | j d  rt# j$   } | j% t& | j' d    | j( d  rx | j) d  D] \ } } | j t j j t  |   t! j" d k r| j t j j t  |  d  | j t j j t  |  d  | j t j j t  |  d  qqWqn  | j* |  | |  _+ d S(   s  
        Uninstall the distribution currently satisfying this requirement.

        Prompts before removing or modifying files unless
        ``auto_confirm`` is True.

        Refuses to delete or modify files outside of ``sys.prefix`` -
        thus uninstallation within a virtual environment can only
        modify that virtual environment, even if the virtualenv is
        linked to global site-packages.

        s.   Cannot uninstall requirement %s, not installeds	   .egg-infos   -py%sR   s   .eggs   installed-files.txts   top_level.txts   namespace_packages.txts   .pys   .pycs   easy-install.pths   ./R   s;   Egg-link %s does not match installed location of %s (at %s)t   scriptst   win32s   .bats   entry_points.txtt   console_scriptss   .exes   .exe.manifests
   -script.pyN(,   t   check_if_existsR   RL   R;   R<   t   UninstallPathSetRS   RT   Rm   Rc   t   egg_nameR   R0   t   PY_MAJORR   Rk   t   addR   R   R   RU   R   t   dirnamet   add_pthR   t   normcaset   readlineRR   R   Rq   t   metadata_isdirt   metadata_listdirR   R   t   platformR   t   SafeConfigParsert   readfpt   FakeFilet   get_metadata_linest   has_sectiont   itemsR   RA   (   RD   t   auto_confirmt   distt   paths_to_removet   pip_egg_info_patht   debian_egg_info_patht   easy_install_eggt   develop_egg_linkt   pip_egg_info_existst   debian_egg_info_existsR   t   installed_fileRT   t
   namespacesR   t   top_level_pkgt   easy_install_ptht   fht   link_pointerR   t   configRL   t   value(    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt	   uninstall  s~    	!"	
.	*  -c         C   s4   |  j  r |  j  j   n t j d |  j f  d  S(   Ns'   Can't rollback %s, nothing uninstalled.(   RA   t   rollbackR	   t   errorRy   (   RD   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   rollback_uninstall  s    		c         C   s4   |  j  r |  j  j   n t j d |  j f  d  S(   Ns%   Can't commit %s, nothing uninstalled.(   RA   t   commitR	   R  Ry   (   RD   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   commit_uninstall  s    		c         C   s  |  j  s t  t } d |  j |  j f } t j j | |  } t j j |  rt	 d t
 |  d  } | d k r t } q| d k r t j d t
 |   t j |  q| d k rt |  } t j d t
 |  t
 |  f  t j | |  qn  | rt j | d t j  } t j j t j j |  j    } xt j |  D] \ }	 }
 } d |
 k r~|
 j d  n  xl |
 D]d } t j j |	 |  } |  j | |  } t j |  j d	 | d	  } d | _ | j | d  qWxb | D]Z } | t k rqn  t j j |	 |  } |  j | |  } | j | |  j d	 |  qWqSW| j   t j d 8_ t j  d t
 |   n  d  S(   Ns	   %s-%s.zips/   The file %s exists. (i)gnore, (w)ipe, (b)ackup t   it   wR    s   Deleting %ss   Backing up %s to %ss   pip-egg-infot   /i  i   R   i   s   Saved %s(   R  R  R    i  (!   R5   Rq   RH   RL   R   RS   RT   Rm   Rk   R   R
   RB   R	   RZ   R   R   Rs   Rt   t   zipfilet   ZipFilet   ZIP_DEFLATEDR   RV   R   t   _clean_zip_namet   ZipInfot   external_attrt   writestrt   PIP_DELETE_MARKER_FILENAMEt   writeR   R   R   (   RD   Rn   t   create_archivet   archive_namet   archive_patht   responset	   dest_filet   zipR   t   dirpathR   R   R   RL   t   zipdirR   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   archive   sN    		!	#
c         C   s_   | j  | t j j  s/ t d | | f   | t |  d } | j t j j d  } | S(   Ns$   name %r doesn't start with prefix %ri   R  (   RG   RS   RT   RX   Rq   R   R   (   RD   RL   t   prefix(    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR  )  s
    c            s  |  j  r |  j | |  d  St j d d  } t j j | d  } zvt j d d |  j	 g t
 |  d d | g } |  j s | d g 7} n    d  k	 r | d	   g 7} n  t   r | d
 t j j t j d d d t    g 7} n  t j d |  j  t j d 7_ z* t | | d |  j d |  j d t Wd  t j d 8_ Xt j j |  sqt j d |  d  St |  _ |  j rd  S  f d   } t |  } xN | D]1 }	 |	 j   }	 |	 j d  r| |	  }
 PqqWt j d |   d  S| j   g  } t |  } x[ | D]S }	 |	 j   } t j j  |  rM| t j j! 7} n  | j" t# | |  |
   qW| j   t t j j |
 d  d  } | j$ d j |  d  | j   Wd  t j j |  rt j% |  n  t j& |  Xd  S(   Ns   -records   pip-s   install-record.txts   -csj   import setuptools;__file__=%r;exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))t   installs   --records#   --single-version-externally-manageds   --roots   --install-headerst   includet   siteR   s   Running setup.py install for %si   R   R   R   s   Record file %s not foundc            s4     d  k s t j j |   r# |  St   |   Sd  S(   N(   R9   RS   RT   t   isabsR   (   RT   (   R   (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   prepend_root\  s    s	   .egg-infos;   Could not find .egg-info directory in install record for %ss   installed-files.txtR  s   
('   R6   t   install_editableRg   Rh   RS   RT   Rm   R   R   R}   R   R8   R9   R   R  R   R	   R   RL   R   R   R5   R   RB   Rk   RH   R@   R   RR   R   RZ   R   RW   RX   R   R   R  R   t   rmdir(   RD   t   install_optionst   global_optionsR   t   temp_locationt   record_filenamet   install_argsR   R   R   R   t	   new_linesR   (    (   R   sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR  0  sj    	 				
 
c         C   s   |  j  s t j j |  j  rW t j d |  j  |  j rK t |  j  n  d |  _ n  |  j
 r t j j |  j
  r t |  j
  n  d |  _
 d S(   sV   Remove the source files from this requirement, if they are marked
        for deletions   Removing source in %sN(   t	   is_bundleRS   RT   Rk   t   delete_marker_filenameR	   R   R5   R   R9   R=   (   RD   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   remove_temporary_source~  s    	c         C   s   t  j d |  j  t  j d 7_ zW t t j d d |  j g t |  d d g t |  d |  j	 d |  j
 d	 t Wd  t  j d 8_ Xt |  _ d  S(
   Ns   Running setup.py develop for %si   s   -csl   import setuptools; __file__=%r; exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))t   develops	   --no-depsR   R   R   (   R	   R   RL   R   R   R   R   R}   R   R5   R   RB   RH   R@   (   RD   R#  R$  (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR!    s    7c         C   sa   t  j } xK d d d d d d d d g D]+ } t j | | j    r( t  j } 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$(   R	   t   NOTIFYR^   R_   RR   t   INFO(   RD   R   t   levelt   regex(    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR     s    		c         C   s   |  j  d k r t Sy t j |  j   |  _ Wn t j k
 rC t St j k
 r t j |  j  j  } |  j	 r t
 |  r | |  _ q t   r t |  r t d | j | j f   q q | |  _ n Xt S(   s   Find an installed distribution that satisfies or conflicts
        with this requirement, and set self.satisfied_by or
        self.conflicts_with appropriately.sV   Will not install to the user site because it will lack sys.path precedence to %s in %sN(   R3   R9   RB   R0   t   get_distributionR;   R   t   VersionConflictRy   RC   R   R<   R   R   R   Rc   RH   (   RD   t   existing_dist(    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR     s     	c         C   su   |  j  d  k	 r |  j  S|  j } | s) t St j j t j j | d   ph t j j t j j | d   |  _  |  j  S(   Ns   pip-manifest.txts   pyinstall-manifest.txt(   R>   R9   R=   RB   RS   RT   Rk   Rm   (   RD   R   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR)    s    	!$c   
      c   s;  x |  j  D] } t j j |  } x t j D] } d  } } t j j | | j  } t j j	 |  r, | j
 } t |  } | j   }	 | j   |   j |	  \ } } Pq, q, W| r d | | | f } n d  } t | |  d t d | d t d | Vq
 Wx7 |  j D], } t j j |  } t | |  d | VqWd  S(   Ns   %s+%s@%sR6   R7   R?   R5   (   t   _bundle_editable_dirsRS   RT   t   basenameR   t   backendsR9   Rm   t   bundle_fileRk   RL   R   R   R   t   parse_vcs_bundle_fileR-   RH   RB   t   _bundle_build_dirs(
   RD   t   dest_dirt   packageR   R7   t   revt   vcs_bundle_fileR   R   t   content(    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   bundle_requirements  s0    
		
	c         C   s  |  j  } | s t  t j j | d  } t j j | d  } g  } g  } x#| | | f | | | f g D]\ } }	 }
 t j j |  rj x t j |  D] } t j j |	 |  } |
 j |  t j j |  r t j	 d | | |  f  q n  t j j |	  s(t j
 d |	  t j |	  n  t j t j j | |  |  q Wt j |  smt j |  qmqj qj Wd  |  _  | |  _ | |  _ d  S(   Nt   srct   buildsZ   The directory %s (containing package %s) already exists; cannot move source from bundle %ss   Creating directory %s(   R=   Rq   RS   RT   Rm   Rk   R   R   R	   RZ   R   R   Rs   Rt   R"  R9   R9  R4  (   RD   t   dest_build_dirt   dest_src_dirR   t   src_dirRn   t   bundle_build_dirst   bundle_editable_dirsR5   R:  t   dir_collectionR   t   dest(    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   move_bundle_files  s4    		#		c         C   s%   |  j  s t  t j j |  j  t  S(   N(   R5   Rq   RS   RT   Rm   R  (   RD   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR*    s    N(    (    (    (.   t   __name__t
   __module__R9   RB   RH   RE   t   classmethodRO   Ra   Rf   Rd   Rp   Rx   t   propertyRL   R|   R}   R   R   R   R   R   R   R   R^   t   compileR   R   R   R   R   R   R   R  R  R  R  R  R+  R!  R   R   R)  R?  RI  R*  (    (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR-   %   sP   $			2		*				_			)	N					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).
t   Requirementsc           B   sG   e  Z d    Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   c         C   s   g  |  _  i  |  _ d  S(   N(   t   _keyst   _dict(   RD   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyRE     s    	c         C   s   |  j  S(   N(   RP  (   RD   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   keys  s    c         C   s!   g  |  j  D] } |  j | ^ q
 S(   N(   RP  RQ  (   RD   R   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   values  s    c         C   s   | |  j  k S(   N(   RP  (   RD   t   item(    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   __contains__  s    c         C   s3   | |  j  k r" |  j  j |  n  | |  j | <d  S(   N(   RP  R   RQ  (   RD   R   R   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   __setitem__  s    c         C   s   |  j  | S(   N(   RQ  (   RD   R   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   __getitem__$  s    c         C   sJ   g  |  j    D]& } d t |  t |  |  f ^ q } d d j |  S(   Ns   %s: %ss   Requirements({%s})s   , (   RR  R   Rm   (   RD   t   kRS  (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   __repr__'  s    9(	   RJ  RK  RE   RR  RS  RU  RV  RW  RY  (    (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyRO    s   						t   RequirementSetc           B   s   e  Z d e e e e e e d   Z d   Z d   Z d   Z e d    Z	 e d    Z
 e d    Z d   Z e d  Z d	   Z e e d
  Z e d  Z d   Z d   Z e d  Z d d  Z d   Z d Z d   Z d   Z RS(   c         C   s   | |  _  | |  _ | |  _ | |  _ | |  _ | |  _ |	 |  _ t   |  _ i  |  _	 g  |  _
 | |  _ g  |  _ g  |  _ g  |  _ | |  _ |
 |  _ d  S(   N(   Rn   RD  t   download_dirt   download_cachet   upgradet   ignore_installedt   force_reinstallRO  R   t   requirement_aliasest   unnamed_requirementst   ignore_dependenciest   successfully_downloadedt   successfully_installedt   reqs_to_cleanupR8   RC   (   RD   Rn   RD  R[  R\  R]  R^  R8   Rb  R_  RC   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyRE   .  s     														c         C   sg   g  |  j  j   D] } | j s | ^ q } | j d d    d j g  | D] } t | j  ^ qK  S(   NR   c         S   s   |  j  j   S(   N(   RL   Rj   (   R3   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR   F  s    t    (   R   RS  R4   R   Rm   Rb   R3   (   RD   R3   t   reqs(    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyRf   C  s    c         C   s   | j  } |  j | _ |  j | _ | s: |  j j |  ni |  j |  rn t d | |  j |  | f   n  | |  j | <| j	   | k r | |  j
 | j	   <n  d  S(   Ns5   Double requirement given: %s (already in %s, name=%r)(   RL   R8   RC   Ra  R   t   has_requirementR   t   get_requirementR   Rj   R`  (   RD   t   install_reqRL   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   add_requirementI  s    	c         C   sC   x< | | j    f D]( } | |  j k s7 | |  j k r t Sq Wt S(   N(   Rj   R   R`  RH   RB   (   RD   Ry   RL   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyRh  Z  s    c         C   s   t  |  j j    p |  j S(   N(   R   R   RS  Ra  (   RD   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   has_requirements`  s    c         C   sD   t  d   |  j j   D  r# t St  d   |  j D  r@ t St S(   Nc         s   s   |  ] } | j  Vq d  S(   N(   R6   (   t   .0R3   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pys	   <genexpr>f  s    c         s   s   |  ] } | j  Vq d  S(   N(   R6   (   Rm  R3   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pys	   <genexpr>h  s    (   t   anyR   RS  RH   Ra  RB   (   RD   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   has_editablesd  s
    c         C   sg   |  j  rc t j j |  j   |  _  t j j |  j   r: t St j d  t d t	 |  j     n  t
 S(   Ns!   Could not find download directorys0   Could not find or access download directory '%s'(   R[  RS   RT   t
   expanduserRk   RH   R	   t   fatalR   R
   RB   (   RD   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   is_downloadl  s    	c         C   sl   xU | | j    f D]A } | |  j k r3 |  j | S| |  j k r |  j |  j | Sq Wt d |   d  S(   Ns   No project with the name %r(   Rj   R   R`  t   KeyError(   RD   Ry   RL   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyRi  y  s    c         C   s8   x1 |  j  j   D]  } | j d |  | j   q Wd  S(   NR   (   R   RS  R   R  (   RD   R   R3   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR     s    c         C   s  t  |  j  } t  |  j j    } xc| s3 | r| rK | j d  } n | j d  } t } |  j r | j r | j   | j	 r |  j
 r |  j o t | j	  s | j	 | _ n  d  | _	 q t } n  | j	 r t j d |  q n  | j r | j d  k rE| j |  j  | _ qEn% | rE| j |  j |  j  | _ n  | j d  k	 r' t j j | j  r' t d | | j f   q' q' Wd  S(   Ni    s<   Requirement already satisfied (use --upgrade to upgrade): %ss   Could not install requirement %s because source folder %s does not exist (perhaps --no-download was used without first running an equivalent install with --no-install?)(   R   Ra  R   RS  t   popRH   R^  R6   R   R;   R]  RC   R   R<   R9   RB   R	   R   R5   Rp   RD  Rn   Rr  RS   RT   RW   R   (   RD   t   unnamedRg  t   req_to_installt   install_needed(    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   locate_files  s4    
						%c         C   s%  t  |  j  } t  |  j j    } x| s3 | r | rK | j d  } n | j d  } t } t } d }	 |  j r| j	 r| j
   | j r^|  j rU|  j r| j ry | j | |  j  }
 Wn= t k
 r t } t } qt k
 rt j   d }	 qX|
 j | _ n  | s[|  j o4t | j  sF| j | _ n  d | _ q[q^t } n  | j r| rt j d |  qt j d |  qn  | j	 rt j d |  n^ | r| j r| j j   j d  rt j d t t | j    qt j d |  n  t j d	 7_ zt } | j	 r| j d k ra| j |  j   } | | _ n	 | j } t! j" j# |  j$  st% |  j$  n  | j& |  j'  |  j' r| j(   | j) |  j*  q_| j(   n| r_| j |  j$ |  j'  } t } d }
 t! j" j# t! j" j+ | d
   s| j d k rX|	 r=|	  n  | j | d |  j }
 n t, | j  }
 |
 sst-  |
 ry |  j. |
 | |  j'  Wqt/ k
 rt j   d } t j0 d | | f  t1 d | | |
 f   qXqt } n  | r_| j2 } | rR| j3 |  j$ |  j   x | j4   D]  } | j5 |  |  j6 |  q+Wn |  j' r| | _ | j(   |
 r|
 j7 t8 j9 k r| j) |  j*  qn[ | | _ | j(   | r| j( d t  n  | j:   | r| j r|  j; |  t } n  | j
   | j r\|  j s|  j rP|  j o2t | j  sD| j | _ n  d | _ qYt } q\q_n  | s| j< | j=  | j> rt j d d j+ | j>   n  |  j? s_x | j | j>  D] } y t@ jA jB |  jC } Wn> tD k
 rt j   d } t jE d | | | f  qn X|  jF |  r/qn  tG | |  } | j5 |  |  j6 |  qWn  |  jF | jH  s|  j6 |  n  |  j' s| jI d k	 r|  jJ j5 |  qn |  jJ j5 |  | r	|  jK j5 |  | r	| j r	| j j d  r	|  j; |  q	n  Wd t j d	 8_ Xq' Wd S(   sG   Prepare process. Create temp directories, download and/or unpack files.i    i   s"   Requirement already up-to-date: %ss<   Requirement already satisfied (use --upgrade to upgrade): %ss   Obtaining %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   s!   Installing extra requirements: %rt   ,s.   Invalid requirement: %r (%s) in requirement %ss   file:///N(L   R   Ra  R   RS  Rt  RH   RB   R9   R^  R6   R   R;   R]  R_  R7   t   find_requirementR   R   R   t   exc_infoRC   R   R<   R	   R   Rj   RG   R
   R%   R   R5   Rp   RD  RS   RT   Rk   Rn   Rl   R   Rr  R   R  R[  Rm   R!   Rq   t
   unpack_urlR   Rq  R   R)  RI  R?  R   Rk  R]   R   t   all_schemesR   t   copy_to_build_dirt   add_dependency_linksR   R.   Rb  R0   R1   R2   Ry   t
   ValueErrorR  Rh  R-   RL   R=   Re  Rc  (   RD   t   finderR   t   bundleRu  Rg  Rv  R  t   best_installedt	   not_foundR7   R)  Rc   Ro   t   et   subreqR3   RL   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   prepare_files  s   
								!#			
!						
	

	
		 	!c         C   s   t  j d  t  j d 7_ x |  j D] } | j   q& Wg  } |  j   r_ | j |  j  n  | rx | j |  j  n  x> | D]6 } t	 j
 j |  r t  j d |  t |  q q Wt  j d 8_ d S(   s   Clean up files, remove builds.s   Cleaning up...i   s   Removing temporary dir %s...N(   R	   R   R   Re  R+  t   _pip_has_created_build_dirR   Rn   RD  RS   RT   Rk   R   R   (   RD   R  R3   t
   remove_dirR   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   cleanup_filesY  s    c         C   s1   |  j  t k o0 t j j t j j |  j  t   S(   N(   Rn   R"   RS   RT   Rk   Rm   R  (   RD   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR  p  s    c         C   s   | j  r |  j p |  j } t j d | j | f  t j j | | j  } t	 j
 | j |  t d d | d g d | d d d  S(   Ns   Copying %s to %sR   s   %s/setup.pyt   cleanR   R   s   python setup.py clean(   R6   RD  Rn   R	   R   RL   RS   RT   Rm   Rs   t   copytreeR5   R   (   RD   Rv  t
   target_dirRH  (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR~  t  s    c         C   s   | r |  j  } n | } t |  r4 t | | |  S| j rW t |  rW t | |  S|  j r{ t j j	 |  j  |  _ n  t
 | | |  j |  j   } | r t t j j | t   n  | Sd  S(   N(   R[  R)   R(   t   hashR*   R+   R\  RS   RT   Rp  R,   t   _write_delete_marker_messageRm   R  (   RD   R`   Rc   t   only_downloadt   loct   retval(    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR|  |  s    	c   	      O   sn  g  |  j  j   D] } | j s | ^ q } | rd t j d d j g  | D] } | j ^ qG   n  t j d 7_ z x | D] } | j r t j d | j  t j d 7_ z | j	 d t
  Wd t j d 8_ Xn  y | j | | | |  Wn* | j r| j r| j   n    n  X| j r?| j r?| j   n  | j   q} WWd t j d 8_ X| |  _ d S(   sR   Install everything in this set (after having downloaded and unpacked the packages)s!   Installing collected packages: %ss   , i   s   Found existing installation: %sR   N(   R   RS  R;   R	   R   Rm   RL   R   R<   R   RH   R  R@   R  R  R+  Rd  (	   RD   R#  R$  t   argst   kwargsR   t
   to_installR3   t   requirement(    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR    s2    3		c         C   s  t  j | d t  j  } g  } xJ|  j d f |  j d f f D]*\ } } t j j t j j |   } xt j	 |  D]\ } } } x t
 j D] }	 |	   }
 d  } } |
 j | k r xR | D] } | j |  r Pq q W|
 j t j j | |   \ } } | j |  |
 j } |
 j i | d 6| d 6} | j |
 j  Pq q Wd | k re| j d  n  xQ | D]I } t j j | |  } |  j | |  } | j | d | d d  qlWx_ | D]W } | t k rqn  t j j | |  } |  j | |  } | j | | d |  qW| rw t j j | |  } |  j | |  } | j | d | |  qw qw Wq= W| j d	 |  j    | j   d  S(
   NR  RA  R@  R7   R<  s   pip-egg-infoR  R   s   pip-manifest.txt(   R	  R
  R  Rn   RD  RS   RT   R   RV   R   R   R6  R9   R   RG   t   get_infoRm   R   R7  t   guideR   R  R  R  R  R?  R   (   RD   t   bundle_filenameR  t   vcs_dirsR   R5  R  R   R   R   R   t   vcs_urlt   vcs_revt   vcs_dirR=  t	   vcs_guideR   RL   R   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   create_bundle  sL    +	
	 #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   |  j  g } xP g  |  j j   D] } | j s | ^ q D]# } | j d | j | j f  q8 W| j d  xP g  |  j j   D] } | j r | ^ q D]# } | j d | j | j f  q Wd j |  S(   Ns   %s==%s
sC   # These packages were installed to satisfy the above requirements:
R   (   t   BUNDLE_HEADERR   RS  R4   R   RL   R   Rm   (   RD   t   partsR3   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR?    s    !!c         C   s_   | j  | t j j  s/ t d | | f   | t |  d } | j t j j d  } | S(   Ns$   name %r doesn't start with prefix %ri   R  (   RG   RS   RT   RX   Rq   R   R   (   RD   RL   R  (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR    s
    N(    (   RJ  RK  R9   RB   RE   Rf   Rk  Rh  RM  Rl  Ro  Rr  Ri  R   Rx  R  R  R  R~  R|  R  R  R  R?  R  (    (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyRZ  ,  s,   						'		!	7	c         C   s*   t  j |   t t  j j |  t   d  S(   N(   RS   R   R  RT   Rm   R  (   Rn   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyRl     s    c         C   s*   t  |  d  } | j t  | j   d  S(   NR  (   R   R  t   DELETE_MARKER_MESSAGER   (   t   filepatht	   marker_fp(    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR    s    s   ^(http|https|file):c         c   s  d  } | r | j n d  } | r3 t j |  } n  t j j t j j |    } t |  d | \ }  } xt	 | j
    D]\ } }	 | d 7} |	 j   }	 |	 s| |	 j d  r q| n  | r | j |	  r q| n  |	 j d  s |	 j d  r|	 j d  r|	 d j   }
 n |	 t d  j   j d  }
 t j |   rXt j |  |
  }
 n3 t j |
  st j j t j j |   |
  }
 n  xzt |
 | d |  d | D] } | VqWq| |	 j d	  s|	 j d
  rq| |	 j d  s|	 j d  r|	 j d  r|	 d j   }	 n |	 t d  j   j d  }	 t j j | |	  } t j j |  ri| }	 n  | r| j j |	  qq| |	 j d  s|	 j d  r|	 j d  r|	 d j   }	 n |	 t d  j   j d  }	 | r|	 g | _ qq| |	 j d  rF|	 t d  j   j d  }	 | r| j j |	  qq| |	 j d  rag  | _ q| d |  | f } |	 j d  s|	 j d  r|	 j d  r|	 d j   }	 n |	 t d  j   j d  }	 t j |	 d | d | j } n t j |	 |  } | Vq| Wd  S(   NR4   i   R   s   -rs   --requirementi   t   =t   optionss   -Zs   --always-unzips   -fs   --find-linkss   -is   --index-urls   --extra-index-urls
   --no-indexs   -r %s (line %s)s   -es
   --editableRK   (   R9   t   skip_requirements_regexR^   RN  RS   RT   R   RV   R#   t	   enumerateR   RR   RG   R_   R   t
   _scheme_reR   t   urljoinRm   t   parse_requirementst   lstripRk   t
   find_linksR   t
   index_urlsR-   RO   RK   Ra   (   R   R  R4   R  t
   skip_matcht
   skip_regext   reqs_file_dirR>  t   line_numberR   t   req_urlRT  t   relative_to_reqs_fileR3   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR  
  sn    
$"	c         C   s  |  } d } t j d |  } | rE | j d  } | j d  } n | } t j j |  r t j j t j j | d   s t	 d |   n  t
 |  } n  | j   j d  r | r d | t j j d |  j f Sd | d f Sn  x: t D]2 } | j   j d |  r d	 | | f } q q Wd
 | k r^| rK| d
 | } q^t	 d |    n  | j d
 d  d j   } t j |  sd |  d j g  t j D] } | j d ^ q d }	 t	 |	   n  t j d |   }
 |
 s|
 j d  rt j |  rg  |  j d d  d j d  D] } | r(| ^ q(} | d d k r]| d } q| d d k rz| d } qt	 d |    n |
 j d  } t j d |  }
 |
 r|
 j d  } n  | | d f S(    sS   Parses svn+http://blahblah@rev#egg=Foobar into a requirement
    (Foobar) and a URLs   ^(.+)(\[[^\]]+\])$i   i   s   setup.pys;   Directory %r is not installable. File 'setup.py' not found.s   file:t   __placeholder__s   %s:s   %s+%sR   sb   %s should either by a path to a local project or a VCS url beginning with svn+, git+, hg+, or bzr+i    s   For --editable=%s only s   , s   +URLs    is currently supporteds   (?:#|#.*?&)egg=([^&]*)R   R  it   tagst   branchest   tagt   branchiit   trunks@   --editable=%s is not the right format; it must have #egg=Packages   ^(.*?)(?:-dev|-\d.*)$N(   s   tagsR  s   tags   branch(   R9   R^   R   R   RS   RT   RW   Rk   Rm   R   R&   Rj   RG   R0   R1   R2   R.   R   R   R   R6  RL   R_   (   RJ   RK   R7   R.   t   mt   url_no_extrast   version_controlR   R   t   error_messageR   R   R  R3   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyRF   P  sV    ! 1&8R   c           B   sk   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 e
 d  Z d	   Z d
   Z RS(   sM   A set of file paths to be removed in the uninstallation of a
    requirement.c         C   s@   t    |  _ t    |  _ i  |  _ | |  _ d  |  _ g  |  _ d  S(   N(   t   sett   pathst   _refuset   pthR   R9   t   save_dirt   _moved_paths(   RD   R   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyRE     s    			c         C   s
   t  |  S(   ss   
        Return True if the given path is one we are permitted to
        remove/modify, False otherwise.

        (   R   (   RD   RT   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt
   _permitted  s    c         C   sF   t  |  j  sB t j d |  j j t |  j j  t j f  t	 St
 S(   Ns1   Not uninstalling %s at %s, outside environment %s(   R   R   R	   R   Ry   R   Rc   R   R  RB   RH   (   RD   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   _can_uninstall  s
    	&c         C   s   t  |  } t j j |  s" d  S|  j |  rD |  j j |  n |  j j |  t j j |  d d k r t	 r |  j t
 j |   n  d  S(   Ni   s   .py(   R   RS   RT   Rk   R  R  R   R  t   splitextR   t   impt   cache_from_source(   RD   RT   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR     s    "c         C   sk   t  |  } |  j |  rW | |  j k r@ t |  |  j | <n  |  j | j |  n |  j j |  d  S(   N(   R   R  R  t   UninstallPthEntriesR   R  (   RD   t   pth_filet   entry(    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR     s    c      	   C   s   t    } x} t | d t D]i } t g  | D]@ } | j |  oi | t | j t j j   t j j k ^ q,  s | j	 |  q q W| S(   s   Compact a path set to contain the minimal number of paths
        necessary to contain all paths in the set. If /a/path/ and
        /a/path/to/a/file.txt are both in the set, leave only the
        shorter path.R   (
   R  t   sortedR   Rn  RG   t   rstripRS   RT   RX   R   (   RD   R  t   short_pathsRT   t	   shortpath(    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   compact  s    	Mc         C   s5   t  j j |  j t  j j |  d j t  j j   S(   Ni   (   RS   RT   Rm   R  t
   splitdriveR  RX   (   RD   RT   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   _stash  s    	c         C   s  |  j    s d S|  j s4 t j d |  j j  d St j d |  j j  t j d 7_ t |  j |  j   } z6| r d } n- x | D] } t j |  q Wt	 d d  } |  j
 r t j d  x* |  j |  j
  D] } t j |  q Wn  | d k rt j d	 d
 d d  |  _ xK | D]C } |  j |  } t j d |  |  j j |  t | |  q"Wx! |  j j   D] } | j   qyWt j d |  j j  n  Wd t j d 8_ Xd S(   s[   Remove paths in ``self.paths`` with confirmation (unless
        ``auto_confirm`` is True).Ns7   Can't uninstall '%s'. No files were found to uninstall.s   Uninstalling %s:i   t   ys   Proceed (y/n)? t   ns.   Not removing or modifying (outside of prefix):t   suffixs
   -uninstallR  s   pip-s   Removing file or directory %ss   Successfully uninstalled %s(   R  R  (   R  R  R	   R   R   Ry   R   R  R  R   R  Rg   Rh   R  R  R   R  R   R   R  RS  R   (   RD   R   R  R  RT   t   new_pathR  (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR     s<    			c         C   s   |  j  d k r* t j d |  j j  t St j d |  j j  x> |  j D]3 } |  j	 |  } t j
 d |  t | |  qK Wx |  j D] } | j   q Wd S(   s1   Rollback the changes previously made by remove().s'   Can't roll back %s; was not uninstalleds   Rolling back uninstall of %ss   Replacing %sN(   R  R9   R	   R  R   Ry   RB   R   R  R  R   R   R  R  (   RD   RT   t   tmp_pathR  (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR    s    c         C   s5   |  j  d k	 r1 t |  j   d |  _  g  |  _ n  d S(   s?   Remove temporary save dir: rollback will no longer be possible.N(   R  R9   R   R  (   RD   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR    s    	(   RJ  RK  t   __doc__RE   R  R  R   R   R  R  RB   R   R  R  (    (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR     s   								%	R  c           B   s,   e  Z d    Z d   Z d   Z d   Z RS(   c         C   sG   t  j j |  s% t d |   n  | |  _ t   |  _ d  |  _ d  S(   Ns.   Cannot remove entries from nonexistent file %s(	   RS   RT   RY   R   RQ   R  t   entriesR9   t   _saved_lines(   RD   R  (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyRE     s
    	c         C   sa   t  j j |  } t j d k rM t  j j |  d rM | j d d  } n  |  j j |  d  S(   NR   i    s   \R  (	   RS   RT   R   R   R   R  R   R  R   (   RD   R  (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR     s    &c         C   s   t  j d |  j  t |  j d  } | j   } | |  _ | j   t d   | D  rd d } n d } xQ |  j D]F } y, t  j d |  | j	 t
 | |   Wqt t k
 r qt Xqt Wt |  j d  } | j |  | j   d  S(   Ns   Removing pth entries from %s:t   rbc         s   s!   |  ] } t  d   | k Vq d S(   s   
N(   R    (   Rm  R   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pys	   <genexpr>$  s    s   
s   
s   Removing entry: %st   wb(   R	   R   RQ   R   t	   readlinesR  R   Rn  R  R   R    R  t
   writelines(   RD   R   t   linest   endlineR  (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR     s"    	
	c         C   sk   |  j  d  k r' t j d |  j  t St j d |  j  t |  j d  } | j |  j   | j	   t
 S(   Ns.   Cannot roll back changes to %s, none were mades!   Rolling %s back to previous stateR  (   R  R9   R	   R  RQ   RB   R   R   R  R   RH   (   RD   R   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR  2  s    
(   RJ  RK  RE   R   R   R  (    (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR    s   		
	R   c           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   sQ   Wrap a list of lines in an object with readline() to make
    ConfigParser happy.c         C   s   d   | D |  _  d  S(   Nc         s   s   |  ] } | Vq d  S(   N(    (   Rm  t   l(    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pys	   <genexpr>A  s    (   t   _gen(   RD   R  (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyRE   @  s    c         C   sL   y3 y t  |  j  SWn t k
 r1 |  j j    SXWn t k
 rG d SXd  S(   NR   (   t   nextR  t	   NameErrort   StopIteration(   RD   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR   C  s    c         C   s   |  j  S(   N(   R  (   RD   (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   __iter__L  s    (   RJ  RK  R  RE   R   R  (    (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyR   =  s   			(P   t   email.parserR    RS   R  R0   R^   R   Rs   Rg   R	  t   distutils.utilR   t   pip.locationsR   R   t   pip.exceptionsR   R   R   R   t   pip.vcsR   t   pip.logR	   t   pip.utilR
   R   R   R   R   R   R   R   R   R   R   R   R   R   R   t   pip.backwardcompatR   R   R   R   R   R   R   R    t	   pip.indexR!   R"   t   pip.downloadR#   R$   R%   R&   R'   R(   R)   R*   R+   R,   R  t   objectR-   R  RO  RZ  Rl   R  RN  t   IR  R9   R  RF   R   R  R   (    (    (    sN   /data/av2000/b2b/venv/lib/python2.7/site-packages/pip-1.3-py2.7.egg/pip/req.pyt   <module>   sD   "d:F   		F?|2