ó
^\kdc           @   sG  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
 Z
 d  d l m Z d  d l 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 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. m/ Z/ m0 Z0 d  d	 l1 m2 Z2 m3 Z3 m4 Z4 m5 Z5 m6 Z6 m7 Z7 m8 Z8 m9 Z9 d  d
 l: m; Z; d  d l m< Z< d  d l= m> Z> m? Z? m@ Z@ mA ZA mB ZB mC ZC mD ZD mE ZE mF ZF mG ZG mH ZH d  d lI ZJ d  d lI mK ZK mL ZL mM ZM d  d lN mO ZO mP ZP d „  ZQ d eR f d „  ƒ  YZS d eR f d „  ƒ  YZT d eR f d „  ƒ  YZU d „  ZV e jW d e jX ƒ ZY eZ eZ eZ eZ d „ Z[ d „  Z\ d „  Z] d „  Z^ eZ d „ Z_ d eR f d „  ƒ  YZ` d eR f d  „  ƒ  YZa d! eR f d" „  ƒ  YZb d S(#   iÿÿÿÿ(   t
   FeedParserN(   t   change_root(   t   bin_pyt   running_under_virtualenvt   PIP_DELETE_MARKER_FILENAMEt   write_delete_marker_filet   bin_user(   t   InstallationErrort   UninstallationErrort   UnsupportedWheelt   BestVersionAlreadyInstalledt   InvalidWheelFilenamet   DistributionNotFoundt   PreviousBuildDirError(   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_subprocesst   is_prereleaset   normalize_name(   t   urlparset   urllibt   uses_pycachet   ConfigParsert   string_typest	   HTTPErrort   get_python_versiont   b(   t   Link(   t   build_prefix(   t
   PipSessiont   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_url(   t   move_wheel_filest   Wheelt	   wheel_ext(   t   pkg_resourcest   sixc         C   s”   t  |  d ƒ � } | j ƒ  } Wd QXd t j t ƒ d g } x9 | D]1 } y | j | ƒ } Wn t k
 rr qC n XPqC Wt | ƒ t k s� t	 ‚ | S(   sQ  Return the contents of *filename*.

    Try to decode the file contents with utf-8, the preffered system encoding
    (e.g., cp1252 on some Windows machines) and latin1, in that order. Decoding
    a byte string with latin1 will never raise an error. In the worst case, the
    returned string will contain some garbage characters.

    t   rbNs   utf-8t   latin1(
   t   opent   readt   localet   getpreferredencodingt   Falset   decodet   UnicodeDecodeErrort   typet   bytest   AssertionError(   t   filenamet   fpt   datat	   encodingst   enc(    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   read_text_file'   s    	t   InstallRequirementc        
   B   sî  e  Z d' e d' e e d' d' e e d  „	 Z e d' d' d „ ƒ Z e d' 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* e d" „  ƒ Z+ d# „  Z, d$ „  Z- d' d% „ Z. e d& „  ƒ Z/ RS(+   c         C   sl  d |  _  t | t ƒ r9 t j j | ƒ } | j  |  _  n  | |  _ | |  _ | |  _ | |  _	 |	 d  k rr i  }	 n  |	 |  _ | |  _ | |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ | |  _ d  |  _ d  |  _ t |  _ d  |  _ |
 |  _ | |  _ | rt |  _ n] |  j d  k	 r_t g  |  j j D]& } t | d ƒ oM| d d k ^ q*ƒ |  _ n	 t |  _ d  S(   Ni   i    s   !=(    (    t   extrast
   isinstanceR%   R9   t   Requirementt   parset   reqt
   comes_fromt
   source_dirt   editablet   Nonet   editable_optionst   urlt   as_eggt   _egg_info_patht   satisfied_byt   conflicts_witht   _temp_build_dirt
   _is_bundlet   updatet   install_succeededt   uninstalledRA   t   use_user_sitet
   target_dirt   from_bundlet	   pycompilet   Truet   prereleasest   anyt   specsR   (   t   selfRR   RS   RT   RU   RX   RY   R_   Rg   RW   Rd   Re   t   x(    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   __init__A   s<    																					Ec   	      C   s…   t  | | ƒ \ } } } | j d ƒ r6 t | ƒ } n d  } |  | | d | d t d | d | d t ƒ} | d  k	 r� | | _ n  | S(   Ns   file:RT   RU   RX   RW   Rg   (   t   parse_editablet
   startswithR.   RV   Rf   RN   (	   t   clst   editable_reqRS   t   default_vcst   nameRX   t   extras_overrideRT   t   res(    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   from_editablep   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  | r¹| d	 k r¹| j } | j } | j d k rst j d | ƒ rst t j j t j j | j ƒ ƒ ƒ } n  | j t k r¿t | j ƒ } | j ƒ  s¶t d | j ƒ ‚ q¶q¿n | } |  | | d | 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   \.\./s-   %s is not a supported wheel on this platform.RX   Rg   N(   RV   t   stript   ost   patht   normpatht   abspathR-   R)   t   isdirt   sepRn   R   R   R/   R0   t   isfileR   t   warnt   url_without_fragmentt   egg_fragmentt   schemet   ret   searcht   extR8   R7   RG   t	   supportedR	   (	   Ro   Rr   RS   Rg   RX   RR   Rz   t   linkt   wheel(    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt	   from_lineƒ   s4    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)(   RR   t   strRX   R[   RV   R   t   locationRS   RO   R%   t	   from_path(   Rj   t   sRS   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   __str__®   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   ->(   RR   RV   R‹   RS   RO   R%   R�   (   Rj   RŽ   RS   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyR�   À   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]   RV   RR   t   tempfilet   mkdtempt   _ideal_build_dirRU   Rr   t   lowerRy   Rz   t   existst   _make_build_dirt   join(   Rj   t	   build_dirt   unpackRr   (    (    s.   /var/www/testScraper/venv/build/pip/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(   RT   RV   RR   RF   R]   R’   RU   Rr   R“   Ry   Rz   R–   R”   R   t   debugR•   R   R   t   shutilt   moveRZ   (   Rj   t   old_locationt   new_build_dirRr   t   new_location(    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   correct_build_locationÝ   s0    							c         C   s   |  j  d  k r d  S|  j  j S(   N(   RR   RV   t   project_name(   Rj   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyRr   ú   s    c         C   s&   |  j  d  k r d  St j |  j  j ƒ S(   N(   RR   RV   R"   t   quotet   unsafe_name(   Rj   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   url_name   s    c         C   sÂ   y d d  l  } Wn t k
 r/ t d ƒ ‚ n Xd } |  j rs d |  j k rs t j j |  j |  j d | ƒ } n t j j |  j | ƒ } t j	 r¾ t
 | t j ƒ r¾ | j t j ƒ  ƒ } n  | S(   NiÿÿÿÿsB   setuptools must be installed to install from a source distributions   setup.pyt   subdirectory(   t
   setuptoolst   ImportErrorR   RW   Ry   Rz   R–   RT   R:   t   PY2RO   t	   text_typet   encodet   syst   getfilesystemencoding(   Rj   R¦   t
   setup_filet   setup_py(    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyR®     s    
c         C   sî  |  j  s t ‚ |  j r8 t j d |  j |  j f ƒ n t j d |  j |  j f ƒ t j d 7_ z>|  j d k rº t j	 j
 t j	 j |  j  d ƒ ƒ rº t t j	 j |  j  d ƒ ƒ n  |  j } | j d t |  j ƒ ƒ } | j d t |  j ƒ ƒ } t j d	 | d
 g } |  j s| r&g  } nF t j	 j |  j  d ƒ } t j	 j | ƒ s`t j | ƒ n  d d g } t | | 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(   Ns2   Running setup.py (path:%s) egg_info for package %ss7   Running setup.py (path:%s) egg_info for package from %si   t
   distributeR¦   s   distribute.egg-infot   __SETUP_PY__t   __PKG_NAME__s   -ct   egg_infos   pip-egg-infos
   --egg-baset   cwdt   filter_stdoutt   show_stdoutt   command_levelt   command_descs   python setup.py egg_infos   %(Name)s==%(Version)s(   RT   RF   Rr   R   t   notifyR®   RX   t   indentRy   Rz   R}   R–   R   t   _run_setup_pyt   replacet   reprR«   t
   executableRU   R”   t   makedirsR   t   _filter_installRA   t   VERBOSE_DEBUGRR   R9   RP   RQ   t   pkg_infoR    (   Rj   t   force_root_egg_infot   scriptt   egg_info_cmdt   egg_base_optiont   egg_info_dir(    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   run_egg_info!  s8    	 	4		
			s}  
__file__ = __SETUP_PY__
from setuptools.command import egg_info
import pkg_resources
import os
import tokenize
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(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))
c         C   sy   |  j  d  k	 r5 |  j  j | ƒ s% d  S|  j  j | ƒ S|  j sD t ‚ |  j | ƒ } t j j	 | ƒ si d  St
 | ƒ } | S(   N(   R[   RV   t   has_metadatat   get_metadataRT   RF   t   egg_info_pathRy   Rz   R”   RL   (   Rj   RG   RI   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   egg_info_datab  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   countRy   Rz   R~   t   altsep(   Rk   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   <lambda>’  s   i    (   RZ   RV   RU   RT   Ry   Rz   R–   t   listdirt   walkR   t   dirnamest   removet   listR”   t   extendt   endswithR   RF   t   lent   sort(	   Rj   RG   t   baset	   filenamest   roott   dirst   filest   dirt   f(    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyRÊ   n  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
   splitlinesRx   Rn   t   append(   Rj   RG   RI   t   resultt   line(    (    s.   /var/www/testScraper/venv/build/pip/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   R€   R   RÊ   t   feedt   close(   Rj   t   pRI   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyRÁ   ¤  s    	#c         C   s   |  j  d ƒ S(   Ns   dependency_links.txt(   Rê   (   Rj   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   dependency_links¬  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(   RV   Rê   t   _requirements_section_ret   matchR“   t   groupR   Rš   (   Rj   RN   t   in_extraRé   Rñ   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   requirements²  s    c         c   s5   x. |  j  j D]  \ } } | d k r | Vq q Wd  S(   Ns   ==(   RR   Ri   (   Rj   t	   qualifiert   version(    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   absolute_versions¿  s    c         C   s   |  j  ƒ  d S(   NRö   (   RÁ   (   Rj   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   installed_versionÅ  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(   RT   RF   Rø   RR   R   R€   Rš   R   (   Rj   Rö   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   assert_source_matches_versionÉ  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(   RX   R   t   infoRT   RU   RF   Rn   R_   t   splitR   t   get_backendt   obtaint   export(   Rj   Rþ   t   vc_typeRX   t   backendt   vcs_backend(    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   update_editableÒ  s(    	"		c         C   sp  |  j  ƒ  s% t d |  j f ƒ ‚ n  |  j p4 |  j } t | ƒ } t j j | j	 | j
 ƒ  ƒ d } t j j | j	 d j | j
 ƒ  j d ƒ d  ƒ ƒ d } | j d t j d ƒ } | j
 ƒ  d } t | ƒ } t j j | ƒ }	 t j j | ƒ }
 t j j | ƒ } |	 s|
 r^|	 r#| } n | } | j | ƒ | j d	 ƒ r–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 | ƒ r»| j | j	 ƒ t j j t j j | j	 ƒ d ƒ } | j | d | ƒ nâ | rj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	 ƒ n3 | r�x* t j  j! | ƒ D] } | j | ƒ qƒWn  | j d ƒ rA| j" d ƒ rAxƒ | j# d ƒ D]o } t$ | ƒ ræt% } n t& } | j t j j | | ƒ ƒ t' j( d k rË| j t j j | | ƒ d ƒ qËqËWn  | j d ƒ rVt) j* ƒ  } | j+ t, | j- d ƒ ƒ ƒ | j. d ƒ rVxÉ | j/ d ƒ D]µ \ } } t$ | ƒ r¸t% } n t& } | j t j j | | ƒ ƒ t' j( d k r—| j t j j | | ƒ d ƒ | j t j j | | ƒ d ƒ | j t j j | | ƒ d ƒ q—q—WqVn  | j0 | ƒ | |  _1 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-infot   -i   s
   .dist-infos   -py%sRë   s   .eggs   installed-files.txts   top_level.txts   namespace_packages.txts   .pys   .pycs   easy-install.pths   ./t   rs;   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(2   t   check_if_existsR   Rr   R[   R\   t   UninstallPathSetRy   Rz   R–   RŒ   t   egg_nameRü   R»   R9   t   PY_MAJORR   R”   t   addRÈ   RÉ   Ræ   R{   RÛ   t   dirnamet   add_pthR=   t   normcaset   readlineRx   Rí   RF   t   pipR‰   t   uninstallation_pathst   metadata_isdirt   metadata_listdirR   R   R   R«   t   platformR$   t   SafeConfigParsert   readfpt   FakeFilet   get_metadata_linest   has_sectiont   itemsRØ   Ra   (   Rj   t   auto_confirmt   distt   paths_to_removet   pip_egg_info_patht   dist_info_patht   debian_egg_info_patht   easy_install_eggt   develop_egg_linkt   pip_egg_info_existst   debian_egg_info_existst   dist_info_existsRÊ   t   installed_fileRz   t
   namespacesRî   t   top_level_pkgt   easy_install_ptht   fht   link_pointerRÃ   t   bin_dirt   configRr   t   value(    (    s.   /var/www/testScraper/venv/build/pip/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   errorR¡   (   Rj   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   rollback_uninstallY  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   R3  R¡   (   Rj   (    (    s.   /var/www/testScraper/venv/build/pip/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(   R7  R8  R(   i  í(!   RT   RF   Rf   Rr   Rø   Ry   Rz   R–   R”   R   R   RA   R   R€   RØ   R   R›   Rœ   t   zipfilet   ZipFilet   ZIP_DEFLATEDR  R|   RÖ   t   _clean_zip_namet   ZipInfot   external_attrt   writestrR   t   writeRí   R¹   R¸   (   Rj   R—   t   create_archivet   archive_namet   archive_patht   responset	   dest_filet   zipRã   t   dirpathR×   Rß   R  Rr   t   zipdirRG   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   archiveg  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   R9  (   Rn   Ry   Rz   R~   RF   RÜ   R»   (   Rj   Rr   t   prefix(    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyR=  �  s
    c            sˆ  |  j  r |  j | | ƒ d  S|  j rt t j j |  j ƒ } t j j | |  j ƒ |  j	 |  j d ˆ  ƒt
 |  _ d  St j d d ƒ } t j j | d ƒ } z¶t j g } | j d ƒ | j d |  j ƒ | t | ƒ d d | g 7} |  j s| d	 g 7} n  ˆ  d  k	 r | d
 ˆ  g 7} n  |  j r9| d g 7} n | d g 7} 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" | ƒ s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( | ƒ rä| 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" | ƒ rvt j, | ƒ n  t j- | ƒ Xd  S(   NRà   s   -records   pip-s   install-record.txts   -cs�   import setuptools, tokenize;__file__=%r;exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))t   installs   --records#   --single-version-externally-manageds   --roots	   --compiles   --no-compiles   --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(   RV   Ry   Rz   t   isabsR   (   Rz   (   Rà   (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   prepend_rootÎ  s    s	   .egg-infos;   Could not find .egg-info directory in install record for %ss   installed-files.txtR8  s   
(.   RU   t   install_editablet   is_wheelR  R‰   t   wheel_versionRT   t   check_compatibilityRr   R6   Rf   R`   R�   R‘   Ry   Rz   R–   R«   R½   Rç   R®   RÙ   RY   RV   Re   R   RK  R'   R   R¸   R¹   R   R¿   RA   R”   R=   Rx   RÛ   R€   Rí   R}   R~   R   RA  RØ   t   rmdir(   Rj   t   install_optionst   global_optionsRà   Rö   t   temp_locationt   record_filenamet   install_argsRP  Rä   Ré   RÆ   t	   new_linesRG   (    (   Rà   s.   /var/www/testScraper/venv/build/pip/pip/req.pyRL  —  s‚    								
 
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_bundleRy   Rz   R”   t   delete_marker_filenameR   Rû   RT   R   RV   R]   (   Rj   (    (    s.   /var/www/testScraper/venv/build/pip/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   -cs‘   import setuptools, tokenize; __file__=%r; exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))t   develops	   --no-depsR³   R´   Rµ   (   R   R¸   Rr   R¹   R   R«   R½   R®   RÙ   RT   R¿   RA   Rf   R`   (   Rj   RV  RW  (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyRQ  ü  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…   Rx   t   INFO(   Rj   Ré   t   levelt   regex(    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyR¿     s    		c         C   s  |  j  d k r t SyJ |  j  j d k rG |  j rG |  j j d k rG t St j |  j  ƒ |  _ Wnž t j	 k
 rt 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.R¦   R¯   sV   Will not install to the user site because it will lack sys.path precedence to %s in %sN(   RR   RV   RA   R¡   R\   Rf   R9   t   get_distributionR[   R   t   VersionConflictRb   R   R   R   R   RŒ   (   Rj   t   existing_dist(    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyR	    s(    		c         C   s   |  j  o d |  j  k S(   Ns   .whl(   RX   (   Rj   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyRR  9  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^   RV   R]   RA   Ry   Rz   R”   R–   (   Rj   RÞ   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyR\  =  s    	!$c   
      c   sG  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 | d t ƒVq
 Wx= |  j D]2 } t j j | ƒ } t | |  d | d t ƒVqWd  S(   Ns   %s+%s@%sRU   RX   R_   RT   Rd   (   t   _bundle_editable_dirsRy   Rz   t   basenameR   t   backendsRV   R–   t   bundle_fileR”   Rr   R=   R>   Rí   t   parse_vcs_bundle_fileRM   Rf   RA   t   _bundle_build_dirs(
   Rj   t   dest_dirt   packageR  RX   t   revt   vcs_bundle_fileR   RH   t   content(    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   bundle_requirementsI  s,    
		
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]   RF   Ry   Rz   R–   R”   RÕ   Rç   R   R€   Rû   R¾   R›   Rœ   RU  RV   Rl  Rg  (   Rj   t   dest_build_dirt   dest_src_dirRÞ   t   src_dirR—   t   bundle_build_dirst   bundle_editable_dirsRT   Rm  t   dir_collectionR  t   dest(    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   move_bundle_filesc  s4    		#		c         C   s;   t  |  j |  j | d |  j d |  j d | d |  j ƒd  S(   Nt   usert   homeRà   Re   (   R6   Rr   RR   Rb   Rc   Re   (   Rj   t   wheeldirRà   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyR6     s    		c         C   s%   |  j  s t ‚ t j j |  j  t ƒ S(   N(   RT   RF   Ry   Rz   R–   R   (   Rj   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyR]  ˆ  s    N(    (    (    (0   t   __name__t
   __module__RV   RA   Rf   Rl   t   classmethodRu   RŠ   R�   R�   R™   R    t   propertyRr   R¤   R®   RÇ   Rº   RË   RÊ   Rê   RÁ   Rï   R„   t   compileRð   Rô   R÷   Rø   Rù   R  R1  R4  R6  RJ  R=  RL  R^  RQ  R¿   R	  RR  R\  Rr  R|  R6   R]  (    (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyRM   ?   sV   -*			?		*				n			)	Y			!			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(   Rj   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyRl   �  s    	c         C   s   |  j  S(   N(   R†  (   Rj   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   keys”  s    c         C   s!   g  |  j  D] } |  j | ^ q
 S(   N(   R†  R‡  (   Rj   RÑ   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   values—  s    c         C   s   | |  j  k S(   N(   R†  (   Rj   t   item(    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   __contains__š  s    c         C   s3   | |  j  k r" |  j  j | ƒ n  | |  j | <d  S(   N(   R†  Rç   R‡  (   Rj   RÑ   R0  (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   __setitem__�  s    c         C   s   |  j  | S(   N(   R‡  (   Rj   RÑ   (    (    s.   /var/www/testScraper/venv/build/pip/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   , (   Rˆ  R¼   R–   (   Rj   t   kR‰  (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   __repr__¥  s    9(	   R€  R�  Rl   Rˆ  R‰  R‹  RŒ  R�  R�  (    (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyR…  Ž  s   						t   RequirementSetc           B   s  e  Z d e e e d e e e d e d 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 d e d „ Z d d „ Z d „  Z d Z d „  Z d „  Z RS(   c         C   sß   | |  _  | |  _ | |  _ | r6 t j j | ƒ } n  | |  _ | |  _ | |  _ |
 |  _	 t
 ƒ  |  _ i  |  _ g  |  _ |	 |  _ g  |  _ g  |  _ g  |  _ | |  _ | |  _ | |  _ | pÃ t ƒ  |  _ | |  _ | |  _ d  S(   N(   R—   Rw  t   download_dirRy   Rz   t
   expandusert   download_cachet   upgradet   ignore_installedt   force_reinstallR…  Rô   t   requirement_aliasest   unnamed_requirementst   ignore_dependenciest   successfully_downloadedt   successfully_installedt   reqs_to_cleanupRY   Rb   Rc   R+   t   sessionRe   t   wheel_download_dir(   Rj   R—   Rw  R‘  R“  R”  R•  RY   Rc   R™  R–  Rb   R�  Re   Rž  (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyRl   ¬  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(   Rr   R“   (   RR   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyRÔ   Ì  s    t    (   Rô   R‰  RS   RÝ   R–   R‹   RR   (   Rj   RR   t   reqs(    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyR�   É  s    c         C   s¿   | j  } |  j | _ |  j | _ |  j | _ |  j | _ | sR |  j j | ƒ ni |  j | ƒ r† t d | |  j	 | ƒ | f ƒ ‚ n  | |  j
 | <| j ƒ  | k r» | |  j | j ƒ  <n  d  S(   Ns5   Double requirement given: %s (already in %s, name=%r)(   Rr   RY   Rb   Rc   Re   R˜  Rç   t   has_requirementR   t   get_requirementRô   R“   R—  (   Rj   t   install_reqRr   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   add_requirementÏ  s    	c         C   sC   x< | | j  ƒ  f D]( } | |  j k s7 | |  j k r t Sq Wt S(   N(   R“   Rô   R—  Rf   RA   (   Rj   R¡   Rr   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyR¡  â  s    c         C   s   t  |  j j ƒ  ƒ p |  j S(   N(   RÙ   Rô   R‰  R˜  (   Rj   (    (    s.   /var/www/testScraper/venv/build/pip/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(   RU   (   t   .0RR   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pys	   <genexpr>î  s    c         s   s   |  ] } | j  Vq d  S(   N(   RU   (   R¦  RR   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pys	   <genexpr>ð  s    (   Rh   Rô   R‰  Rf   R˜  RA   (   Rj   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   has_editablesì  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‘  Ry   Rz   R’  R”   Rf   R   t   fatalR   R   RA   (   Rj   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   is_downloadô  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(   R“   Rô   R—  t   KeyError(   Rj   R¡   Rr   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyR¢    s    c         C   s8   x1 |  j  j ƒ  D]  } | j d | ƒ | j ƒ  q Wd  S(   NR  (   Rô   R‰  R1  R6  (   Rj   R  RR   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyR1  	  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Ù   R˜  Rô   R‰  t   popRf   R•  RU   R	  R[   R”  Rb   R   R\   RV   RA   R   R¸   RT   R™   Rw  R—   R©  Ry   Rz   R}   R   (   Rj   t   unnamedR   t   req_to_installt   install_needed(    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   locate_files  s4    
						%c         C   s–  t  |  j ƒ } t  |  j j ƒ  ƒ } xk| 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_ zYt } t } | j	 rÙ| j d k rg| j |  j  ƒ } | | _ n	 | j } t! j" j# |  j$ ƒ s•t% |  j$ ƒ n  | j& |  j' ƒ |  j' rÌ| j( ƒ  | j) |  j* ƒ q| j( ƒ  nD| r| j |  j$ |  j' ƒ } t } d }
 | j+ rnEt! j" j# t! j" j, | d
 ƒ ƒ rSt- t. j/ d | | f ƒ ƒ ‚ n| j d k rŒ|	 rq|	 ‚ n  | j | d |  j ƒ}
 n t0 | j ƒ }
 |
 s§t1 ‚ |
 rOyY |
 j2 j3 t4 ƒ rÝ|  j5 rÝ|  j5 } t } n |  j* } |  j' } |  j6 |
 | | | ƒ WqUt7 k
 rK} t j8 d | | f ƒ t9 d | | |
 f ƒ ‚ qUXn t } | r| j: } |
 oy|
 j2 j3 t4 ƒ } | rÌ| j; |  j$ |  j  ƒ xý | j< ƒ  D]  } | j= | ƒ |  j> | ƒ q¥WnÌ |  j' r| | _ | sñ| j( ƒ  n  |
 r˜|
 j? t@ jA k r˜| j) |  j* ƒ q˜ny | r=| | _ |
 j | _ n[ | | _ | j( ƒ  | ri| j( d t ƒ n  | jB ƒ  | r˜| j r˜|  jC | ƒ t } n  |  j s®| j
 ƒ  n  | j r|  j sÉ|  j rý|  j oßt | j ƒ sñ| j | _ n  d | _ qt j d | ƒ t } qqn  | r×t  tD jE | ƒ ƒ d } | jF sd| jG ƒ  | _F |  j> | ƒ n  |  jH süxd | jI | jJ ƒ D]M } |  jK | jL ƒ ržq€n  tM tN | ƒ | ƒ } | j= | ƒ |  j> | ƒ q€Wqün%| sü| jO | jP ƒ | jJ rt j d d j, | jJ ƒ ƒ n  |  jH s×xµ | j | jJ ƒ D]ž } y tD jQ jR | ƒ jL } Wn> tS k
 r‘t j ƒ  d } t jT d | | | f ƒ q2n X|  jK | ƒ r§q2n  tM | | ƒ } | j= | ƒ |  j> | ƒ q2Wn  |  jK | jU ƒ sü|  j> | ƒ qün  | s0|  j' s| jV d k	 r0|  jW j= | ƒ q0n  | rz|  jX j= | ƒ | rz| j rz| j j d ƒ rz|  jC | ƒ qz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.pys‘  
                          pip can't proceed with requirement '%s' due to a pre-existing build directory.
                           location: %s
                          This is likely due to a previous installation that failed.
                          pip is being responsible and not assuming it can delete this.
                          Please delete it and try again.
                        R”  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(Y   RÙ   R˜  Rô   R‰  R«  Rf   RA   RV   R•  RU   R	  R[   R”  R–  RX   t   find_requirementR
   R   R«   t   exc_infoRb   R   R\   R   R¸   R“   Rn   R   R.   R¹   RT   R™   Rw  Ry   Rz   R”   R—   R•   R  R©  RÇ   RJ  R‘  Rd   R–   R   t   textwrapt   dedentR)   RF   RG   RÛ   R8   Rž  t
   unpack_urlR&   R¨  R   R\  R|  Rr  Rç   R¤  Rƒ   R   t   all_schemesRù   t   copy_to_build_dirR9   t   find_distributionsRR   t   as_requirementR™  t   requiresRN   R¡  R¡   RM   R‹   t   add_dependency_linksRï   RP   RQ   t
   ValueErrorR3  Rr   R]   Rœ  Rš  (   Rj   t   finderRÂ   t   bundleR¬  R   R­  RL  t   best_installedt	   not_foundRX   R\  RR  RŒ   R˜   R‘  t   do_downloadt   exct   et   subreqR  RR   Rr   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   prepare_files5  sV   
								!#			
	!													

								 		!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¹   Rœ  R^  t   _pip_has_created_build_dirRç   R—   Rw  Ry   Rz   R”   Rû   R   (   Rj   R¾  RR   t
   remove_dirRã   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   cleanup_files"  s    c         C   s1   |  j  t k o0 t j j t j j |  j  t ƒ ƒ S(   N(   R—   R*   Ry   Rz   R”   R–   R   (   Rj   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyRÆ  9  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(   RU   Rw  R—   R   Rû   Rr   Ry   Rz   R–   R›   t   copytreeRT   R   (   Rj   R­  Rc   R{  (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyR·  =  s    c         C   s±   | d  k r |  j } n  t | ƒ rL | r3 | } n | } t | | | ƒ na t | ƒ r~ t | | | ƒ | r­ t | ƒ q­ n/ t | | |  j | |  j	 ƒ | r­ t | ƒ n  d  S(   N(
   RV   R‘  R2   R1   R3   R4   R   R5   R“  R�  (   Rj   Rˆ   RŒ   R‘  t   only_downloadt   loc(    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyRµ  E  s&    	
c         O   s2  g  |  j  j ƒ  D] } | j s | ^ q } t j j d ƒ } xI | D]A } | j d k rD | j | k rD | j | ƒ | j	 | ƒ qD qD W| rÂ t
 j d d j g  | D] } | j ^ q¥ ƒ ƒ n  t
 j d 7_ zAx:| D]2}	 |	 j d k rGy= t j j d ƒ }
 t j d ƒ } | |
 k r,| |	 _ n  WqGt j k
 rCqGXn  |	 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   distribute>=0.7R¯   s!   Installing collected packages: %ss   , i   R¦   s   distribute<0.7s   Found existing installation: %sR  N(   Rô   R‰  R[   R9   RP   RQ   Rr   Rø   RØ   Rç   R   R¸   R–   R¹   Rd  R\   R   R1  Rf   RL  R`   R4  R6  R^  R›  (   Rj   RV  RW  t   argst   kwargsR  t
   to_installt   distribute_reqRR   t   requirementt   distribute_requirementt   existing_distribute(    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyRL  d  sL    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(
   NR8  Rt  Rs  RX   Ro  s   pip-egg-infoR9  Rë   s   pip-manifest.txt(   R:  R;  R<  R—   Rw  Ry   Rz   R  R|   RÖ   R   Ri  RV   R  Rn   t   get_infoR–   Rç   Rj  t   guideRØ   R=  R@  R   RA  Rr  Rí   (   Rj   t   bundle_filenameRG  t   vcs_dirsRã   Rh  RH  R×   Rß   R  R  t   vcs_urlt   vcs_revt   vcs_dirRp  t	   vcs_guideR  Rr   RG   (    (    s.   /var/www/testScraper/venv/build/pip/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ô   R‰  RS   Rç   Rr   Rø   R–   (   Rj   t   partsRR   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyRr  â  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   R9  (   Rn   Ry   Rz   R~   RF   RÜ   R»   (   Rj   Rr   RK  (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyR=  î  s
    N(    (   R€  R�  RV   RA   Rf   Rl   R�   R¤  R¡  Rƒ  R¥  R§  R©  R¢  R1  R¯  RÅ  RÈ  RÆ  R·  Rµ  RL  RÜ  RÝ  Rr  R=  (    (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyR�  ª  s2   							'í		E	7	c         C   s   t  j |  ƒ t |  ƒ d  S(   N(   Ry   R¾   R   (   R—   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyR•   ö  s    s   ^(http|https|file):c         c   sÀ  | d  k r t ƒ  } n  d  } | r- | j n d  } | rK t j | ƒ } n  t j j t j j |  ƒ ƒ } t	 |  d | d | ƒ\ }  } x2t
 | j ƒ  ƒ D]\ }	 }
 |	 d 7}	 |
 j ƒ  }
 t j d d |
 ƒ }
 |
 sš |
 j d ƒ rí qš n  | r| j |
 ƒ rqš n  |
 j d ƒ s&|
 j d ƒ rò|
 j d ƒ rH|
 d	 j ƒ  } n |
 t d ƒ j ƒ  j d
 ƒ } t j |  ƒ r‹t j |  | ƒ } n3 t j | ƒ s¾t j j t j j |  ƒ | ƒ } n  x÷t | | d |  d | d | ƒD] } | VqàWqš |
 j d ƒ s¸|
 j d ƒ rqš |
 j d ƒ s1|
 j d ƒ r¾|
 j d ƒ rS|
 d	 j ƒ  }
 n |
 t d ƒ j ƒ  j d
 ƒ }
 t j j | |
 ƒ } t j j | ƒ r¢| }
 n  | r¸| j j |
 ƒ q¸qš |
 j d ƒ sÜ|
 j d ƒ r5|
 j d ƒ rþ|
 d	 j ƒ  }
 n |
 t d ƒ j ƒ  j d
 ƒ }
 | r¸|
 g | _ q¸qš |
 j d ƒ r|
 t d ƒ j ƒ  j d
 ƒ }
 | r¸| j j |
 ƒ q¸qš |
 j d ƒ ršt | _ qš |
 j d ƒ rµg  | _ qš |
 j d ƒ r
|
 t d ƒ j ƒ  j d
 ƒ }
 | j t t |
 ƒ j  ƒ  g ƒ O_ qš |
 j d ƒ r%t | _! qš |
 j d ƒ r7qš |
 j d ƒ rIqš |
 j d ƒ rž|
 t d ƒ j ƒ  j d
 ƒ }
 | j" t t |
 ƒ j  ƒ  g ƒ O_" qš |
 j d ƒ ró|
 t d ƒ j ƒ  j d
 ƒ }
 | j" t t |
 ƒ j  ƒ  g ƒ O_" qš d |  |	 f } |
 j d ƒ s!|
 j d ƒ r�|
 j d ƒ rC|
 d	 j ƒ  }
 n |
 t d ƒ j ƒ  j d
 ƒ }
 t# j$ |
 d | d | rƒ| j% n d  ƒ} n$ t# j& |
 | d t' | d  d  ƒ ƒ} | Vqš Wd  S(!   NRS   R�  i   s
   (^|\s)#.*$Rë   Rå   s   -rs   --requirementi   t   =t   optionss   -Zs   --always-unzips   -fs   --find-linkss   -is   --index-urls   --extra-index-urls   --use-wheels
   --no-indexs   --allow-externals   --allow-all-externals   --no-allow-externals   --no-allow-insecures   --allow-insecures   --allow-unverifieds   -r %s (line %s)s   -es
   --editableRq   Rg   t   pre((   RV   R+   t   skip_requirements_regexR„   R„  Ry   Rz   R  R|   R,   t	   enumerateRæ   Rx   t   subRn   R…   RÜ   t
   _scheme_reR!   t   urljoinR–   t   parse_requirementst   lstripR”   t
   find_linksRç   t
   index_urlsRf   t	   use_wheelt   allow_externalt   setR    R“   t   allow_all_externalt   allow_unverifiedRM   Ru   Rq   RŠ   t   getattr(   RG   R½  RS   Rà  R�  t
   skip_matcht
   skip_regext   reqs_file_dirRq  t   line_numberRé   t   req_urlRŠ  t   relative_to_reqs_fileRR   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyRç  þ  sš    	
$(	''''$c         C   s.   t  j d |  ƒ } | r* | j d ƒ }  n  |  S(   s2   
        Strip req postfix ( -dev, 0.2, etc )
    s   ^(.*?)(?:-dev|-\d.*)$i   (   R„   R…   Rò   (   RR   Rñ   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   _strip_postfixb  s    c         C   s|   g  |  j  d d ƒ d j  d ƒ D] } | r  | ^ q  } d  } | d d k r[ | d
 } n | d d k rx | d } n  | S(   NRå   i   i    R9  iþÿÿÿt   tagst   branchest   tagt   branchiýÿÿÿiÿÿÿÿt   trunk(   s   tagss   branchess   tags   branch(   Rü   RV   (   RX   Rî   RÞ  RR   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   _build_req_from_urlm  s    8c         C   s{   t  j d ƒ } | j |  ƒ } | rw t ƒ  } xC | D]; } | \ } } | | k re t d | ƒ ‚ n  | | | <q4 W| Sd S(   sz   
        This method generates a dictionary of the query string
        parameters contained in a given editable URL.
    s(   [\?#&](?P<name>[^&=]+)=(?P<value>[^&=]+)s   %s option already definedN(   R„   R„  t   findallt   dictt	   ExceptionRV   (   RR   t   regexpt   matchedt   rett   optionRr   R0  (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   _build_editable_optionsx  s    	c         C   sy  |  } 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]3 } | j ƒ  j d | ƒ rò d	 | | f } Pqò qò Wd
 | k r_| rL| 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  y t |  ƒ }
 Wn7 t k
 rt j ƒ  d } t	 d |  | f ƒ ‚ n X|
 s.d |
 k rVt |  ƒ } | s`t	 d |  ƒ ‚ q`n
 |
 d } t | ƒ } | | |
 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 be 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*   --editable=%s error in editable options:%st   eggs@   --editable=%s is not the right format; it must have #egg=PackageN(   RV   R„   Rñ   Rò   Ry   Rz   R}   R”   R–   R   R/   R“   Rn   R9   RP   RQ   RN   R   Rü   Rý   Ri  Rr   R  R   R«   R²  Rý  R÷  (   Rp   Rq   RX   RN   t   mt   url_no_extrast   version_controlR   R  t   error_messageRà  t   messageRR   Rn  (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyRm   Œ  sT    ! 1
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(   Rí  t   pathst   _refuset   pthR  RV   t   save_dirt   _moved_paths(   Rj   R  (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyRl   Ð  s    			c         C   s
   t  | ƒ S(   ss   
        Return True if the given path is one we are permitted to
        remove/modify, False otherwise.

        (   R   (   Rj   Rz   (    (    s.   /var/www/testScraper/venv/build/pip/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¸   R¡   R   RŒ   R«   RK  RA   Rf   (   Rj   (    (    s.   /var/www/testScraper/venv/build/pip/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   Ry   Rz   R”   R  R  R  R  t   splitextR#   t   impt   cache_from_source(   Rj   Rz   (    (    s.   /var/www/testScraper/venv/build/pip/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  (   Rj   t   pth_filet   entry(    (    s.   /var/www/testScraper/venv/build/pip/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Ü   Rh   Rn   t   rstripRy   Rz   R~   R  (   Rj   R  t   short_pathsRz   t	   shortpath(    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   compactþ  s    	Mc         C   s5   t  j j |  j t  j j | ƒ d j t  j j ƒ ƒ S(   Ni   (   Ry   Rz   R–   R  t
   splitdriveRè  R~   (   Rj   Rz   (    (    s.   /var/www/testScraper/venv/build/pip/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
   -uninstallRK  s   pip-s   Removing file or directory %ss   Successfully uninstalled %s(   R!  R"  (   R  R  R   R¸   R  R¡   R¹   R  R  R   R  R�   R‘   R  R   Rû   R  Rç   R   R  R‰  RØ   (   Rj   R  R  RE  Rz   t   new_pathR  (    (    s.   /var/www/testScraper/venv/build/pip/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  RV   R   R3  R  R¡   RA   R¸   R  R   Rû   R   R  R2  (   Rj   Rz   t   tmp_pathR  (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyR2  4  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  RV   R   R  (   Rj   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyR5  A  s    	(   R€  R�  t   __doc__Rl   R  R  R  R  R  R   RA   RØ   R2  R5  (    (    (    s.   /var/www/testScraper/venv/build/pip/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(	   Ry   Rz   R   R   Rw   Rí  t   entriesRV   t   _saved_lines(   Rj   R  (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyRl   J  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   \R9  (	   Ry   Rz   R  R«   R  R  R»   R'  R  (   Rj   R  (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyR  Q  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:R;   c         s   s!   |  ] } t  d  ƒ | k Vq d S(   s   
N(   R(   (   R¦  Ré   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pys	   <genexpr>b  s    s   
s   
s   Removing entry: %st   wb(   R   Rû   Rw   R=   t	   readlinesR(  Rí   Rh   R'  RØ   R(   R¼  t
   writelines(   Rj   R,  t   linest   endlineR  (    (    s.   /var/www/testScraper/venv/build/pip/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(  RV   R   R3  Rw   RA   Rû   R=   R+  Rí   Rf   (   Rj   R,  (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyR2  p  s    
(   R€  R�  Rl   R  RØ   R2  (    (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyR  I  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(    (   R¦  t   l(    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pys	   <genexpr>  s    (   t   _gen(   Rj   R,  (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyRl   ~  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(   Rj   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyR  �  s    c         C   s   |  j  S(   N(   R/  (   Rj   (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   __iter__Š  s    (   R€  R�  R&  Rl   R  R3  (    (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyR  {  s   			(c   t   email.parserR    Ry   R  R?   R„   R«   R›   R�   R³  R:  t   distutils.utilR   t   pip.locationsR   R   R   R   R   t   pip.exceptionsR   R   R	   R
   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   R   R    t   pip.backwardcompatR!   R"   R#   R$   R%   R&   R'   R(   t	   pip.indexR)   R*   t   pip.downloadR+   R,   R-   R.   R/   R0   R1   R2   R3   R4   R5   t	   pip.wheelR  R6   R7   R8   t   pip._vendorR9   R:   RL   t   objectRM   R…  R�  R•   R„  t   IRå  RV   Rç  R÷  Rý  R  Rm   R
  R  R  (    (    (    s.   /var/www/testScraper/venv/build/pip/pip/req.pyt   <module>   sT   (4p:L	ÿ ÿ ÿ Rÿ ÿ N		c			A|2