£Á°èZ¨Ä…–K§‚«“ô4“ÒÙ´dîfUÙÃÅ WKbyÊ¦•êŽ…È®FÒ¿ÊÎóCozá¬S@6{Í:›œêZÌ:Š•_%:¢¾¾~;‘Ã~èŠ©ÊÇí`ÔÑ©úë™µ'5I¿fš×WO%ø9¾«¾DK|€ùÍD”Ýs]nHÕ¶ê×Ó¼ãžªéUWŸÈË%DÒÕ¬ï‘]/Åcx  ‰ï2ß]ä6G[]S£ÔÏ¯rs{úëóµmÒï#UQxo·õÞCe]"±/aÙ&Eã4ú9Jé_ÞåëdãöKë)AÞ                  ¯¹ægƒÛowÐø^d™ý½ßB7áyMä9ÜÖUã
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<html>

Re c               @   s  d  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
 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 Z d d l m Z m Z d d l m Z d d l m Z m 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& m' Z' d d l( m) Z) d d l* m+ Z+ d d l, m- Z- d d l, m. Z. d d l( m/ Z/ m0 Z0 d d l1 m2 Z2 m3 Z3 m4 Z4 m5 Z5 m6 Z6 d d l m7 Z7 m8 Z8 m9 Z9 m: Z: m; Z; m< Z< m= Z= m> Z> m? Z? m@ Z@ mA ZA mB ZB mC ZC mD ZD mE ZE e jF jG d e jH jI e jJ   ZK d d d d d d g ZL d d   ZM d d   ZN e jO d f k rd d   ZP d  d!   ZQ n d" d   ZP d# d!   ZQ Gd$ d   d e  ZR d% d&   ZS d' d(   ZT d) d   ZU d* d   ZV d+ d,   ZW Gd- d   d e=  ZX eK eY d. d/  ZZ d0 d1   Z[ d2 d3   Z\ d4 d5   Z] d6 d7 d8  Z^ d9 d:   Z_ d; d<   Z` d= d>   Za y d d? l mb Zc Wn ed k
 rd@ dA   Zc Yn XdB dC   Zb dD dE   Ze GdF dG   dG ef  Zg GdH dI   dI eg  Zh GdJ dK   dK eh  Zi eg jj Zj dL dM   Zk dN dO   Zl eY e[ dP dQ  Zm dR dS   Zn dT dU   Zo ep dV d  Zq d S(W   u  
Easy Install
------------

A tool for doing automatic download/extract/build of distutils-based Python
packages.  For detailed documentation, see the accompanying EasyInstall.txt
file, or visit the `EasyInstall home page`__.

__ https://pythonhosted.org/setuptools/easy_install.html

i    N(   u   glob(   u   logu   dir_util(   u   Commandu   _dont_write_bytecode(   u	   run_setup(   u   get_pathu   get_config_vars(   u   get_platform(   u   convert_pathu
   subst_vars(   u   DistutilsArgErroru   DistutilsOptionErroru   DistutilsErroru   DistutilsPlatformError(   u   INSTALL_SCHEMESu   SCHEME_KEYS(   u   setopt(   u   unpack_archive(   u   PackageIndex(   u
   URL_SCHEME(   u	   bdist_eggu   egg_info(   u	   iteritemsu   maxsizeu
   basestringu   unicodeu   reraise(   u   yield_linesu   normalize_pathu   resource_stringu   ensure_directoryu   get_distributionu   find_distributionsu   Environmentu   Requirementu   Distributionu   PathMetadatau   EggMetadatau
   WorkingSetu   DistributionNotFoundu   VersionConflictu   DEVELOP_DISTu   __VENV_LAUNCHER__u   samefileu   easy_installu   PthDistributionsu   extract_wininst_cfgu   mainu   get_exe_prefixesc               C   s   t  j d  d k S(   Nu   Pi   (   u   structu   calcsize(    (    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   is_64bit@   s    u   is_64bitc             C   s   t  j j |   o! t  j j |  } t t  j d  o9 | } | rU t  j j |  |  St  j j t  j j |    } t  j j t  j j |   } | | k S(   Nu   samefile(   u   osu   pathu   existsu   hasattru   samefileu   normpathu   normcase(   u   p1u   p2u
   both_existu   use_samefileu   norm_p1u   norm_p2(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   samefileC   s    $i   c             C   s   |  S(   N(    (   u   s(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu	   _to_asciiM   s    u	   _to_asciic             C   s2   y t  |  d  d SWn t k
 r- d SYn Xd  S(   Nu   asciiTF(   u   unicodeu   Trueu   UnicodeErroru   False(   u   s(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   isasciiO   s
    u   isasciic             C   s   |  j  d  S(   Nu   ascii(   u   encode(   u   s(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu	   _to_asciiV   s    c             C   s2   y |  j  d  d SWn t k
 r- d SYn Xd  S(   Nu   asciiTF(   u   encodeu   Trueu   UnicodeErroru   False(   u   s(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   isasciiX   s
    c             B   s'  |  Ee  Z d  Z d Z d Z d Z d d d d d d d d d d d d d d d d d d d d d g Z d d d d d d. d1 d7 d: g	 Z	 e
 j r d> e
 j Z e j d? d e f  e	 j d?  n  i d d( 6Z e Z d@ dA   Z dB dC   Z dD dE   Z dF dG   Z dH dI   Z dJ dK   Z dL dM   Z dN dO   Z dP dQ   Z dR dS   Z dT dU   Z dV dW   Z dX dY   Z dZ d[   Z d\ d]   Z  d^ d_   Z! d d` da  Z# d db dc  Z$ dd de   Z% d df dg  Z& dh di   Z' dj dk   Z( dl dm   Z) d dn do  Z* dp f  dq dr  Z+ ds dt   Z, du dv   Z- dw dx   Z. dy dz   Z/ d{ d|   Z0 d} d~ d  Z1 d d   Z2 d d   Z3 d d   Z4 d d   Z5 d d   Z6 d d   Z7 d d   Z8 d d   Z9 d d   Z: d d   Z; d d   Z< e= d e= d d d d   Z> e= d d d d  Z? d d   Z@ d S(   u   easy_installu'   Manage a download/build/install processu    Find/get/install Python packagesu   prefix=u   installation prefixu   zip-oku   zu   install package as a zipfileu   multi-versionu   mu%   make apps have to require() a versionu   upgradeu   Uu1   force upgrade (searches PyPI for latest versions)u   install-dir=u   du   install package to DIRu   script-dir=u   su   install scripts to DIRu   exclude-scriptsu   xu   Don't install scriptsu   always-copyu   au'   Copy all needed packages to install diru
   index-url=u   iu    base URL of Python Package Indexu   find-links=u   fu(   additional URL(s) to search for packagesu   build-directory=u   bu/   download/extract/build in DIR; keep the resultsu	   optimize=u   Oul   also compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0]u   record=u3   filename in which to record list of installed filesu   always-unzipu   Zu*   don't install as a zipfile, no matter whatu
   site-dirs=u   Su)   list of directories where .pth files worku   editableu   eu+   Install specified packages in editable formu   no-depsu   Nu   don't install dependenciesu   allow-hosts=u   Hu$   pattern(s) that hostnames must matchu   local-snapshots-oku   lu(   allow building eggs from local checkoutsu   versionu"   print version information and exitu   no-find-linksu9   Don't load find-links defined in packages being installedu!   install in user site-package '%s'u   userc             C   s  t  j r3 t j j t  } | j t  j  |  _ n	 d |  _ d  |  _
 |  _ d  |  _ |  _ |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ |  _ d  |  _ |  _ |  _ d  |  _ |  _ |  _ d  |  _ |  _ |  _ d  |  _ d  |  _ d  |  _  d  |  _! d  |  _" d  |  _# d  |  _$ d  |  _% d  |  _& t  j rQt  j' |  _( t  j |  _) n d  |  _( d  |  _) d  |  _* d  |  _+ d  |  _, |  _- d  |  _. i  |  _/ d |  _1 d  |  _2 |  j3 j4 |  _4 |  j3 j5 |  |  j3 j6 d   d  S(   Ni    u   easy_installF(7   u   siteu   ENABLE_USER_SITEu   osu   pathu   abspathu   __file__u
   startswithu	   USER_SITEu   useru   Noneu   zip_oku   local_snapshots_oku   install_diru
   script_diru   exclude_scriptsu	   index_urlu
   find_linksu   build_directoryu   argsu   optimizeu   recordu   upgradeu   always_copyu   multi_versionu   editableu   no_depsu   allow_hostsu   rootu   prefixu	   no_reportu   versionu   install_purelibu   install_platlibu   install_headersu   install_libu   install_scriptsu   install_datau   install_baseu   install_platbaseu	   USER_BASEu   install_userbaseu   install_usersiteu   no_find_linksu   package_indexu   pth_fileu   always_copy_fromu	   site_dirsu   installed_projectsu   Falseu   sitepy_installedu   _dry_runu   distributionu   verboseu   _set_command_optionsu   get_option_dict(   u   selfu   whereami(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   initialize_options   sL    																									u   easy_install.initialize_optionsc             C   s   x | D] } t  j j |  s1 t  j j |  r t j d |  |  j s t  j j |  r| t  j j |  r| t |  q t  j	 |  q q q Wd  S(   Nu   Deleting %s(
   u   osu   pathu   existsu   islinku   logu   infou   dry_runu   isdiru   rmtreeu   unlink(   u   selfu   blockersu   filename(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   delete_blockers   s    $	%u   easy_install.delete_blockersc       	      C   sx  |  j  r- t d t d  j   t j   n  t j  j   d } t d d  \ } } i |  j j   d 6|  j j	   d 6|  j j
   d 6| d	 6| d d
  d 6| d | d d 6| d 6| d 6| d 6| d 6t t d d  d 6|  _ t j r|  j |  j d <|  j |  j d <n  |  j rt j r|  j   |  j d  k rNt d   n  |  j |  _ |  _ t j d k r|  j d  q|  j t j d  n  |  j   |  j   |  j d d d d  |  j d  k r|  j |  _ n  |  j d  k rd. |  _ n  |  j! d d/  |  j! d d0  |  j rG|  j" rG|  j" |  _ |  j# |  _ n  |  j! d d1  t$ t% t j&  } t'   |  _( |  j) d  k	 rd  d!   |  j) j d"  D } xq | D]f } t j& j* |  st+ j, d# |  qt% |  | k rt- | d$   q|  j( j. t% |   qWn  |  j/ s-|  j0   n  |  j1 p9d% |  _1 |  j( d  d   |  _2 xE |  j t% |  j  f D]+ } | |  j2 k rn|  j2 j3 d |  qnqnW|  j4 d  k	 rd& d!   |  j4 j d"  D } n	 d' g } |  j5 d  k r|  j6 |  j1 d( |  j2 d) | |  _5 n  t7 |  j2 t j&  |  _8 |  j9 d  k	 r_t: |  j9 t;  rh|  j9 j   |  _9 qhn	 g  |  _9 |  j< r|  j5 j= |  j2 t j&  n  |  j s|  j5 j> |  j9  n  |  j! d d2  t: |  j? t@  s1y> t@ |  j?  |  _? d |  j? k od k n stA  n  Wq1tA k
 r-t- d+   Yq1Xn  |  j/ rS|  jB rStC d,   n  |  jD sktC d-   n  g  |  _E d  S(3   Nu   setuptools %su
   setuptoolsi    u   prefixu   exec_prefixu	   dist_nameu   dist_versionu   dist_fullnameu
   py_versioni   u   py_version_shorti   u   py_version_nodotu
   sys_prefixu   sys_exec_prefixu   abiflagsu    u   userbaseu   usersiteu$   User base directory is not specifiedu   posixu	   unix_useru   _useru   install_diru
   script_diru   build_directoryu	   site_dirsu   install_libu   install_scriptsu   installu   recordc             S   s(   g  |  ] } t  j j | j     q S(    (   u   osu   pathu
   expanduseru   strip(   u   .0u   s(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu
   <listcomp>  s   	 u1   easy_install.finalize_options.<locals>.<listcomp>u   ,u"   %s (in --site-dirs) does not existu$    (in --site-dirs) is not on sys.pathu   https://pypi.python.org/simplec             S   s   g  |  ] } | j     q S(    (   u   strip(   u   .0u   s(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu
   <listcomp>)  s   	 u   *u   search_pathu   hostsu   optimizeu   --optimize must be 0, 1, or 2u9   Must specify a build directory (-b) when using --editableu:   No urls, filenames, or requirements specified (see --help)F(   u   install_diru   install_dir(   u   install_diru
   script_dir(   u   recordu   record(   u   optimizeu   optimize(F   u   versionu   printu   get_distributionu   sysu   exitu   splitu   get_config_varsu   distributionu   get_nameu   get_versionu   get_fullnameu   getattru   config_varsu   siteu   ENABLE_USER_SITEu   install_userbaseu   install_usersiteu   useru   create_home_pathu   Noneu   DistutilsPlatformErroru   install_baseu   install_platbaseu   osu   nameu   select_schemeu   expand_basedirsu   expand_dirsu   _expandu
   script_diru   install_diru   no_find_linksu   Falseu   set_undefined_optionsu   install_purelibu   install_scriptsu   mapu   normalize_pathu   pathu   get_site_dirsu   all_site_dirsu	   site_dirsu   isdiru   logu   warnu   DistutilsOptionErroru   appendu   editableu   check_site_diru	   index_urlu   shadow_pathu   insertu   allow_hostsu   package_indexu   create_indexu   Environmentu   local_indexu
   find_linksu
   isinstanceu
   basestringu   local_snapshots_oku   scan_egg_linksu   add_find_linksu   optimizeu   intu
   ValueErroru   build_directoryu   DistutilsArgErroru   argsu   outputs(	   u   selfu
   py_versionu   prefixu   exec_prefixu   normpathu	   site_dirsu   du	   path_itemu   hosts(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   finalize_options   s    		


			 "	!			 	u   easy_install.finalize_optionsc             C   s   x | D]y } t  |  |  } | d  k	 r t j d k sF t j d k r[ t j j |  } n  t | |  j  } t |  | |  q q Wd  S(   Nu   posixu   nt(	   u   getattru   Noneu   osu   nameu   pathu
   expanduseru
   subst_varsu   config_varsu   setattr(   u   selfu   attrsu   attru   val(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   _expand_attrsM  s    u   easy_install._expand_attrsc             C   s   |  j  d d d g  d S(   uN   Calls `os.path.expanduser` on install_base, install_platbase and
        root.u   install_baseu   install_platbaseu   rootN(   u   _expand_attrs(   u   self(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   expand_basedirsV  s    u   easy_install.expand_basedirsc             C   s#   |  j  d d d d d d g  d S(   u+   Calls `os.path.expanduser` on install dirs.u   install_purelibu   install_platlibu   install_libu   install_headersu   install_scriptsu   install_dataN(   u   _expand_attrs(   u   self(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   expand_dirs[  s    u   easy_install.expand_dirsc             C   s  |  j  |  j j  k r( t j |  j   n  z x% |  j D] } |  j | |  j  q5 W|  j r |  j } |  j	 r t
 |  j	  } x5 t t
 |   D] } | | | d   | | <q Wn  d d l m } |  j | j |  j | f d |  j  n  |  j   Wd  t j |  j j   Xd  S(   Ni    (   u	   file_utilu'   writing list of installed files to '%s'(   u   verboseu   distributionu   logu   set_verbosityu   argsu   easy_installu   no_depsu   recordu   outputsu   rootu   lenu   rangeu	   distutilsu	   file_utilu   executeu
   write_fileu   warn_deprecated_options(   u   selfu   specu   outputsu   root_lenu   counteru	   file_util(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   runa  s$    			u   easy_install.runc          
   C   sG   y t  j   } Wn t j d t  } Yn Xt  j j |  j d |  S(   u   Return a pseudo-tempname base in the install directory.
        This code is intentionally naive; if a malicious party can write to
        the target directory you're already in deep doodoo.
        i    u   test-easy-install-%s(   u   osu   getpidu   randomu   randintu   maxsizeu   pathu   joinu   install_dir(   u   selfu   pid(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   pseudo_tempnamew  s
    u   easy_install.pseudo_tempnamec             C   s   d  S(   N(    (   u   self(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   warn_deprecated_options  s    u$   easy_install.warn_deprecated_optionsc             C   s  t  |  j  } t j j | d  } | |  j k } | rS |  j rS |  j   } n |  j   d } t j j	 |  } y: | r t j
 |  n  t | d  j   t j
 |  Wn" t t f k
 r |  j   Yn X| r |  j r t |  j     n  | r*|  j d k r3t | |  j  |  _ q3n	 d |  _ t j j d d  j t j  } | t t  d d   | D  k rd	 |  _ n1 |  j rt j j	 |  rd	 |  _ d |  _ n  | |  _ d S(
   u;   Verify that self.install_dir is .pth-capable dir, if neededu   easy-install.pthu   .write-testu   wu
   PYTHONPATHu    c             S   s   g  |  ] } | r |  q S(    (    (   u   .0u   _f(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu
   <listcomp>  s   	 u/   easy_install.check_site_dir.<locals>.<listcomp>NT(   u   normalize_pathu   install_diru   osu   pathu   joinu   all_site_dirsu   multi_versionu   check_pth_processingu   pseudo_tempnameu   existsu   unlinku   openu   closeu   OSErroru   IOErroru   cant_write_to_targetu   DistutilsErroru   no_default_version_msgu   pth_fileu   Noneu   PthDistributionsu   environu   getu   splitu   pathsepu   mapu   Trueu   sitepy_installed(   u   selfu   instdiru   pth_fileu   is_site_diru   testfileu   test_existsu
   PYTHONPATH(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   check_site_dir  s6     	!"	u   easy_install.check_site_dirc             C   s_   d } | t  j   d |  j f } t j j |  j  sE | d 7} n
 | d 7} t |   d  S(   Nu  can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    %s

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    %s
i   u   
This directory does not currently exist.  Please create it and try again, or
choose a different installation directory (using the -d or --install-dir
option).
uK  
Perhaps your account does not have write access to this directory?  If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account.  If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.

For information on other options, you may wish to consult the
documentation at:

  https://pythonhosted.org/setuptools/easy_install.html

Please make the appropriate changes for your system and try again.
(   u   sysu   exc_infou   install_diru   osu   pathu   existsu   DistutilsError(   u   selfu   templateu   msg(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   cant_write_to_target  s    
u!   easy_install.cant_write_to_targetc             C   s.  |  j  } t j d |  |  j   d } | d } t j j |  } y] | r^ t j |  n  t j j |  } t j j |  s t j	 |  n  t
 | d  } Wn" t t f k
 r |  j   YnHXz | j d | f  | j   d } t j } t j d k rct j j |  \ } } t j j | d  }	 | j   d k rct j j |	  rc|	 } qcn  d	 d
 l m }
 |
 | d d d g d	  t j j |  rt j d |  d SWd | r| j   n  t j j |  rt j |  n  t j j |  rt j |  n  X|  j s*t j d |  n  d S(   u@   Empirically verify whether .pth files are supported in inst. diru    Checking .pth file support in %su   .pthu   .oku   wu7   import os; f = open(%r, 'w'); f.write('OK'); f.close()
u   ntu   pythonw.exeu
   python.exei    (   u   spawnu   -Eu   -cu   passu-   TEST PASSED: %s appears to support .pth filesNu+   TEST FAILED: %s does NOT support .pth filesTF(   u   install_diru   logu   infou   pseudo_tempnameu   osu   pathu   existsu   unlinku   dirnameu   makedirsu   openu   OSErroru   IOErroru   cant_write_to_targetu   writeu   closeu   Noneu   sysu
   executableu   nameu   splitu   joinu   loweru   distutils.spawnu   spawnu   Trueu   multi_versionu   warnu   False(   u   selfu   instdiru   pth_fileu   ok_fileu	   ok_existsu   dirnameu   fu
   executableu   basenameu   altu   spawn(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   check_pth_processing  sP    	
 
	$	u!   easy_install.check_pth_processingc             C   s   |  j  ro | j d  ro xS | j d  D]? } | j d |  rH q) n  |  j | | | j d |   q) Wn  |  j |  d S(   u=   Write all the scripts for `dist`, unless scripts are excludedu   scriptsu   scripts/N(   u   exclude_scriptsu   metadata_isdiru   metadata_listdiru   install_scriptu   get_metadatau   install_wrapper_scripts(   u   selfu   distu   script_name(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   install_egg_scripts  s    u    easy_install.install_egg_scriptsc             C   s|   t  j j |  rh xc t  j |  D]? \ } } } x- | D]% } |  j j t  j j | |   q8 Wq" Wn |  j j |  d  S(   N(   u   osu   pathu   isdiru   walku   outputsu   appendu   join(   u   selfu   pathu   baseu   dirsu   filesu   filename(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu
   add_output  s
    *u   easy_install.add_outputc             C   s#   |  j  r t d | f   n  d  S(   Nuj   Invalid argument %r: you can't use filenames or URLs with --editable (except via the --find-links option).(   u   editableu   DistutilsArgError(   u   selfu   spec(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   not_editable  s    	u   easy_install.not_editablec             C   sW   |  j  s d  St j j t j j |  j | j   rS t d | j |  j f   n  d  S(   Nu2   %r already exists in %s; can't do a checkout there(   u   editableu   osu   pathu   existsu   joinu   build_directoryu   keyu   DistutilsArgError(   u   selfu   spec(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   check_editable$  s    	'u   easy_install.check_editablec             C   s  t  j d d  } d  } |  j s. |  j   n  zYt | t  s t |  r |  j |  |  j	 j
 | |  } |  j d  | | | d  St j j |  r |  j |  |  j d  | | | d  St |  } n  |  j |  |  j	 j | | |  j |  j |  j |  j  } | d  k rDd | } |  j r5| d 7} n  t |   nB | j t k rm|  j | | | d  | S|  j | | j | |  SWd  t j j |  rt |  n  Xd  S(   Nu   prefixu   easy_install-u+   Could not find suitable distribution for %ru2    (--always-copy skips system and development eggs)u   UsingT(   u   tempfileu   mkdtempu   Noneu   editableu   install_site_pyu
   isinstanceu   Requirementu
   URL_SCHEMEu   not_editableu   package_indexu   downloadu   install_itemu   Trueu   osu   pathu   existsu   parse_requirement_argu   check_editableu   fetch_distributionu   upgradeu   always_copyu   local_indexu   DistutilsErroru
   precedenceu   DEVELOP_DISTu   process_distributionu   locationu   rmtree(   u   selfu   specu   depsu   tmpdiru   downloadu   distu   msg(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   easy_install.  s:    	 	
	u   easy_install.easy_installc             C   s  | p |  j  } | p* t j j |  | k } | p@ | j d  } | p| |  j d  k	 o| t j j t |   t |  j  k } | r | r x4 |  j | j	 D] } | j
 | k r Pq q Wd } n  t j d t j j |   | r!|  j | | |  } xP | D] } |  j | | |  qWn, |  j |  g } |  j | | d | d  | d  k	 r}x! | D] } | | k r`| Sq`Wn  d  S(   Nu   .eggu   Processing %si    u   UsingT(   u   always_copyu   osu   pathu   dirnameu   endswithu   always_copy_fromu   Noneu   normalize_pathu   local_indexu   project_nameu   locationu   Trueu   logu   infou   basenameu   install_eggsu   process_distributionu   egg_distribution(   u   selfu   specu   downloadu   tmpdiru   depsu   install_neededu   distu   dists(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   install_itemW  s.    	u   easy_install.install_itemc             C   sU   t  | } xD t D]< } d | } t |  |  d k r t |  | | |  q q Wd S(   u=   Sets the install directories by applying the install schemes.u   install_N(   u   INSTALL_SCHEMESu   SCHEME_KEYSu   getattru   Noneu   setattr(   u   selfu   nameu   schemeu   keyu   attrname(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   select_scheme{  s
    

u   easy_install.select_schemec             G   s6  |  j  |  |  j j |  |  j j |  |  j |  | |  j | j <t j |  j	 | | |   | j
 d  r |  j r |  j j | j d   n  | r |  j r d  S| d  k	 r | j | j k r t j d |  d  S| d  k s | | k r0| j   } | p| } t | j | j | j  } n  t j d |  y( t g   j | g |  j |  j  } Wni t k
 rt j   d } t d | j   Yn5 t k
 rt j   d } t d | j   Yn X|  j s|  j r"x9 | D]. } | j |  j k r|  j | j    qqWn  t j d |  d  S(   Nu   dependency_links.txtu   Skipping dependencies for %su   Processing dependencies for %si   u'   Could not find required distribution %su7   Installed distribution %s conflicts with requirement %su'   Finished processing dependencies for %s(    u
   update_pthu   package_indexu   addu   local_indexu   install_egg_scriptsu   installed_projectsu   keyu   logu   infou   installation_reportu   has_metadatau   no_find_linksu   add_find_linksu   get_metadata_linesu   always_copyu   Noneu   warnu   as_requirementu   Requirementu   project_nameu   specsu   extrasu
   WorkingSetu   resolveu   easy_installu   DistributionNotFoundu   sysu   exc_infou   DistutilsErroru   argsu   VersionConflictu   always_copy_from(   u   selfu   requirementu   distu   depsu   infou   distrequ   distrosu   e(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   process_distribution  sL    
	u!   easy_install.process_distributionc             C   sA   |  j  d  k	 r |  j  S| j d  r* d S| j d  s= d Sd S(   Nu   not-zip-safeu   zip-safeTF(   u   zip_oku   Noneu   has_metadatau   Trueu   False(   u   selfu   dist(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   should_unzip  s    u   easy_install.should_unzipc             C   s  t  j j |  j | j  } t  j j |  rS d } t j | | j |  j |  | St  j j |  rn | } n t  j j	 |  | k r t  j
 |  n  t  j |  } t |  d k r t  j j | | d  } t  j j |  r | } q n  t |  t j | |  | S(   Nu<   %r already exists in %s; build directory %s will not be kepti   i    (   u   osu   pathu   joinu   build_directoryu   keyu   existsu   logu   warnu   isdiru   dirnameu   unlinku   listdiru   lenu   ensure_directoryu   shutilu   move(   u   selfu   specu   dist_filenameu
   setup_baseu   dstu   msgu   contents(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu
   maybe_move  s"    	
u   easy_install.maybe_movec             C   s4   |  j  s0 x$ t |  D] } |  j |   q Wn  d  S(   N(   u   exclude_scriptsu   get_script_argsu   write_script(   u   selfu   distu   args(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   install_wrapper_scripts  s    	u$   easy_install.install_wrapper_scriptsc                s   t  | j    } t | |  }   f d d   } | rz d   | rZ   j d d    n  t |  |    t   } n  |  j | t |  d  d S(   u/   Generate a legacy script wrapper and install itc                s4   t  d    } | j d  } | j d d  } | S(   um  
            There are a couple of template scripts in the package. This
            function loads one of them and prepares it for use.

            These templates use triple-quotes to escape variable
            substitutions so the scripts get the 2to3 treatment when build
            on Python 3. The templates cannot use triple-quotes naturally.
            u
   setuptoolsu   utf-8u   """u    (   u   resource_stringu   decodeu   replace(   u   filenameu	   raw_bytesu   template_stru   clean_template(   u   template_name(    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   get_template  s    	u1   easy_install.install_script.<locals>.get_templateu   script template.pyu   .pyu	    (dev).pyu   bN(   u   stru   as_requirementu   is_python_scriptu   replaceu   get_script_headeru   localsu   write_scriptu	   _to_ascii(   u   selfu   distu   script_nameu   script_textu   dev_pathu   specu	   is_scriptu   get_template(    (   u   template_nameu8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   install_script  s    	u   easy_install.install_scriptu   tc                s     j    f d d   | D  t j d |   j  t j j   j |  }   j |  t   }   j	 s t
 |  t j j |  r t j |  n  t | d |  } | j |  | j   t | d |  n  d S(   u1   Write an executable file to the scripts directoryc                s(   g  |  ] } t  j j   j |   q S(    (   u   osu   pathu   joinu
   script_dir(   u   .0u   x(   u   self(    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu
   <listcomp>  s   	 u-   easy_install.write_script.<locals>.<listcomp>u   Installing %s script to %su   wi  N(   u   delete_blockersu   logu   infou
   script_diru   osu   pathu   joinu
   add_outputu   current_umasku   dry_runu   ensure_directoryu   existsu   unlinku   openu   writeu   closeu   chmod(   u   selfu   script_nameu   contentsu   modeu   blockersu   targetu   masku   f(    (   u   selfu8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   write_script  s    		

u   easy_install.write_scriptc             C   s  | j    j d  r( |  j | |  g S| j    j d  rP |  j | |  g S| } t j j |  r | j d  r t | | |  j  n' t j j	 |  r t j j
 |  } n  | j |  r |  j r | d  k	 r |  j | | |  } n  t j j | d  } t j j |  st t j j | d d   } | s[t d t j j
 |    n  t |  d k rt d t j j
 |    n  | d	 } n  |  j rt j |  j | |   g  S|  j | |  Sd  S(
   Nu   .eggu   .exeu   .pyu   setup.pyu   *u"   Couldn't find a setup script in %si   u   Multiple setup scripts in %si    (   u   loweru   endswithu   install_eggu   install_exeu   osu   pathu   isfileu   unpack_archiveu   unpack_progressu   isdiru   abspathu
   startswithu   build_directoryu   Noneu
   maybe_moveu   joinu   existsu   globu   DistutilsErroru   lenu   editableu   logu   infou   report_editableu   build_and_install(   u   selfu   specu   dist_filenameu   tmpdiru
   setup_baseu   setup_scriptu   setups(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   install_eggs  s4    "	u   easy_install.install_eggsc             C   s[   t  j j |  r3 t | t  j j | d   } n t t j |   } t j	 | d | S(   Nu   EGG-INFOu   metadata(
   u   osu   pathu   isdiru   PathMetadatau   joinu   EggMetadatau	   zipimportu   zipimporteru   Distributionu   from_filename(   u   selfu   egg_pathu   metadata(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   egg_distribution+  s    !u   easy_install.egg_distributionc             C   s  t  j j |  j t  j j |   } t  j j |  } |  j sL t |  n  |  j |  } t	 | |  st  j j
 |  r t  j j |  r t j | d |  j n2 t  j j |  r |  j t  j | f d |  n  t |  t  j j
 |  r+| j |  rt j d } } qt j d } } na |  j |  rZ|  j |  |  j d } } n2 | j |  r|t j d } } n t j d } } |  j | | | f | d t  j j |  t  j j |  f  n  |  j |  |  j |  S(   Nu   dry_runu	   Removing u   Movingu   Copyingu
   Extractingu	    %s to %s(   u   osu   pathu   joinu   install_diru   basenameu   abspathu   dry_runu   ensure_directoryu   egg_distributionu   samefileu   isdiru   islinku   dir_utilu   remove_treeu   existsu   executeu   unlinku   uncache_zipdiru
   startswithu   shutilu   moveu   copytreeu   should_unzipu   mkpathu   unpack_and_compileu   copy2u   dirnameu
   add_output(   u   selfu   egg_pathu   tmpdiru   destinationu   distu   fu   m(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   install_egg2  s4    $	% 
)u   easy_install.install_eggc                s  t  |  } | d  k r+ t d |   n  t d  d | j d d  d | j d d  d t   } t j j | | j	   d  } | _
 | d } t j j | d	  } t j j | d
  } t |  t | |  | _ |  j | |  t j j |  s}t | d  }	 |	 j d  xU | j d  D]D \ }
 } |
 d k r(|	 j d |
 j d d  j   | f  q(q(W|	 j   n  t j j | d    |  j   f d d   t |  D  t j | | d |  j d |  j |  j | |  S(   Nu(   %s is not a valid distutils Windows .exeu   project_nameu   metadatau   nameu   versionu   platformu   .eggu   .tmpu   EGG-INFOu   PKG-INFOu   wu   Metadata-Version: 1.0
u   target_versionu   %s: %s
u   _u   -u   scriptsc                s)   g  |  ] } t  j j   | d    q S(   i    (   u   osu   pathu   join(   u   .0u   args(   u
   script_dir(    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu
   <listcomp>t  s   	 u,   easy_install.install_exe.<locals>.<listcomp>u   verboseu   dry_run(   u   extract_wininst_cfgu   Noneu   DistutilsErroru   Distributionu   getu   get_platformu   osu   pathu   joinu   egg_nameu   locationu   ensure_directoryu   PathMetadatau	   _provideru
   exe_to_eggu   existsu   openu   writeu   itemsu   replaceu   titleu   closeu   delete_blockersu   get_script_argsu	   bdist_eggu   make_zipfileu   verboseu   dry_runu   install_egg(   u   selfu   dist_filenameu   tmpdiru   cfgu   distu   egg_pathu   egg_tmpu	   _egg_infou   pkg_infu   fu   ku   v(    (   u
   script_diru8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   install_exeS  s8    &

0 u   easy_install.install_exec                s  t  |   g   g   i         f d d   } t |   |  g  } x  D] } | j   j d  rY | j d  } | d } t j | d  d | d <t j j	   |  }  j
 |  | j
 |  t j | |  qY qY W|  j   t j t j j	   d  t j   |   x d D] }	 t   |	 r-t j j	   d |	 d
  }
 t j j |
  st |
 d  } | j d j	 t   |	  d  | j   qq-q-Wd S(   u;   Extract a bdist_wininst to the directories an egg would usec                sR  |  j    } x D]\ } } | j |  r | |  t |  d   }  |  j d  } t j j   |  } | j    } | j d  s | j d  r t j	 | d
  | d <d  t j j
 | d  d < j |   nI | j d  r$| d k r$d  t j j
 | d  d < j |  n  | Sq W|  j d  sNt j d	 |   n  d  S(   Nu   /u   .pydu   .dlli   i    u   .pyu   SCRIPTS/u   .pthu   WARNING: can't process %sii(   u   loweru
   startswithu   lenu   splitu   osu   pathu   joinu   endswithu	   bdist_eggu   strip_moduleu   splitextu   appendu   logu   warnu   None(   u   srcu   dstu   su   oldu   newu   partsu   dl(   u   egg_tmpu   native_libsu   prefixesu
   to_compileu	   top_level(    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   process  s$    u(   easy_install.exe_to_egg.<locals>.processu   .pydu   /i   u   .pyu   EGG-INFOu	   top_levelu   native_libsu   .txtu   wu   
Niii(   u	   top_levelu   native_libs(   u   get_exe_prefixesu   unpack_archiveu   loweru   endswithu   splitu	   bdist_eggu   strip_moduleu   osu   pathu   joinu   appendu
   write_stubu   byte_compileu   write_safety_flagu   analyze_eggu   localsu   existsu   openu   writeu   close(   u   selfu   dist_filenameu   egg_tmpu   processu   stubsu   resu   partsu   resourceu   pyfileu   nameu   txtu   f(    (   u   egg_tmpu   native_libsu   prefixesu
   to_compileu	   top_levelu8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu
   exe_to_egg}  s4    
!u   easy_install.exe_to_eggu	   Installedc       	      C   sz   d } |  j  rN |  j rN | d 7} |  j t t t j  k rN | d 7} qN n  | j } | j } | j	 } d } | t
   S(   u9   Helpful installation message for display to package usersu   
%(what)s %(eggloc)s%(extras)su  

Because this distribution was installed --multi-version, before you can
import modules from this package in an application, you will need to
'import pkg_resources' and then use a 'require()' call similar to one of
these examples, in order to select the desired version:

    pkg_resources.require("%(name)s")  # latest installed version
    pkg_resources.require("%(name)s==%(version)s")  # this exact version
    pkg_resources.require("%(name)s>=%(version)s")  # this version or higher
u   

Note also that the installation directory must be on sys.path at runtime for
this to work.  (e.g. by being the application's script directory, by being on
PYTHONPATH, or by being added to sys.path by your code.)
u    (   u   multi_versionu	   no_reportu   install_diru   mapu   normalize_pathu   sysu   pathu   locationu   project_nameu   versionu   locals(	   u   selfu   requ   distu   whatu   msgu   egglocu   nameu   versionu   extras(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   installation_report  s    
			u    easy_install.installation_reportc             C   s&   t  j j |  } t j } d t   S(   Nu"  
Extracted editable version of %(spec)s to %(dirname)s

If it uses setuptools in its setup script, you can activate it in
"development" mode by going to that directory and running::

    %(python)s setup.py develop

See the setuptools documentation for the "develop" command for more info.
(   u   osu   pathu   dirnameu   sysu
   executableu   locals(   u   selfu   specu   setup_scriptu   dirnameu   python(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   report_editable  s    		u   easy_install.report_editablec             C   s+  t  j j d t  t  j j d t  t |  } |  j d k ri d |  j d } | j d d |  n" |  j d k  r | j d d  n  |  j r | j d d	  n  t	 j
 d
 | t |  d d   d j |   y t | |  Wn< t k
 r&t  j   d } t d | j d f   Yn Xd  S(   Nu   distutils.command.bdist_eggu   distutils.command.egg_infoi   u   vi   i    u   -u   -qu   -nu   Running %s %su    u   Setup script exited with %s(   u   sysu   modulesu
   setdefaultu	   bdist_eggu   egg_infou   listu   verboseu   insertu   dry_runu   logu   infou   lenu   joinu	   run_setupu
   SystemExitu   exc_infou   DistutilsErroru   args(   u   selfu   setup_scriptu
   setup_baseu   argsu   v(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu	   run_setup  s"    	*u   easy_install.run_setupc       	      C   s  d d g } t  j d d d t j j |   } z |  j t j j |   | j |  |  j | | |  t | g  } g  } x? | D]7 } x. | | D]" } | j |  j	 | j
 |   q Wq W| r |  j r t j d |  n  | SWd  t |  t j |  j  Xd  S(   Nu	   bdist_eggu
   --dist-diru   prefixu   egg-dist-tmp-u   diru+   No eggs found in %s (setup script problem?)(   u   tempfileu   mkdtempu   osu   pathu   dirnameu   _set_fetcher_optionsu   appendu	   run_setupu   Environmentu   install_eggu   locationu   dry_runu   logu   warnu   rmtreeu   set_verbosityu   verbose(	   u   selfu   setup_scriptu
   setup_baseu   argsu   dist_diru   all_eggsu   eggsu   keyu   dist(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   build_and_install  s$    	$	

u   easy_install.build_and_installc       	      C   s   |  j  j d  j   } d } i  } xF | j   D]8 \ } } | | k rO q1 n  | d | | j d d	  <q1 Wt d |  } t j j | d
  } t	 j
 | |  d S(   u  
        When easy_install is about to run bdist_egg on a source dist, that
        source dist might have 'setup_requires' directives, requiring
        additional fetching. Ensure the fetcher options given to easy_install
        are available to that command as well.
        u   easy_installu
   find_linksu	   site_dirsu	   index_urlu   optimizeu   allow_hostsi   u   _u   -u	   setup.cfgN(   u
   find_linksu	   site_dirsu	   index_urlu   optimizeu	   site_dirsu   allow_hosts(   u   distributionu   get_option_dictu   copyu   itemsu   replaceu   dictu   osu   pathu   joinu   setoptu   edit_config(	   u   selfu   baseu   ei_optsu   fetch_directivesu   fetch_optionsu   keyu   valu   settingsu   cfg_filename(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   _set_fetcher_options  s    	  u!   easy_install._set_fetcher_optionsc             C   s  |  j  d  k r d  Sx~ |  j  | j D]l } |  j sE | j | j k r$ t j d |  |  j  j |  | j |  j k r |  j j | j  q q$ q$ W|  j s| j |  j  j	 k r t j d |  qt j d |  |  j  j
 |  | j |  j k r|  j j | j  qn  |  j s|  j  j   | j d k rt j j |  j d  } t j j |  rot j |  n  t | d  } | j |  j  j | j  d  | j   qn  d  S(   Nu&   Removing %s from easy-install.pth fileu4   %s is already the active version in easy-install.pthu"   Adding %s to easy-install.pth fileu
   setuptoolsu   setuptools.pthu   wtu   
(   u   pth_fileu   Noneu   keyu   multi_versionu   locationu   logu   infou   removeu   shadow_pathu   pathsu   addu   appendu   dry_runu   saveu   osu   pathu   joinu   install_diru   islinku   unlinku   openu   writeu   make_relativeu   close(   u   selfu   distu   du   filenameu   f(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu
   update_pth  s4    	
	  u   easy_install.update_pthc             C   s   t  j d | |  | S(   Nu   Unpacking %s to %s(   u   logu   debug(   u   selfu   srcu   dst(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   unpack_progress@  s    u   easy_install.unpack_progressc                s   g   g       f d d   } t  | | |    j     j s x<  D]1 } t j |  t j d Bd @} t | |  qQ Wn  d  S(   Nc                s   | j  d  r/ |  j d  r/  j |  n. | j  d  sM | j  d  r]  j |  n    j |  |    j r} | p d  S(   Nu   .pyu	   EGG-INFO/u   .dllu   .so(   u   endswithu
   startswithu   appendu   unpack_progressu   dry_runu   None(   u   srcu   dst(   u   selfu   to_chmodu
   to_compile(    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   pfI  s    u+   easy_install.unpack_and_compile.<locals>.pfim  i  (   u   unpack_archiveu   byte_compileu   dry_runu   osu   statu   ST_MODEu   chmod(   u   selfu   egg_pathu   destinationu   pfu   fu   mode(    (   u   selfu   to_chmodu
   to_compileu8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   unpack_and_compileE  s    	u   easy_install.unpack_and_compilec             C   s   t  r |  j d  d  Sd d l m } ze t j |  j d  | | d d d d d |  j |  j r | | d |  j d d d |  j n  Wd  t j |  j  Xd  S(   Nu%   byte-compiling is disabled, skipping.i    (   u   byte_compilei   u   optimizeu   forceu   dry_run(	   u   _dont_write_bytecodeu   warnu   distutils.utilu   byte_compileu   logu   set_verbosityu   verboseu   dry_runu   optimize(   u   selfu
   to_compileu   byte_compile(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   byte_compileX  s    	u   easy_install.byte_compilec             C   s&   d } | |  j  t j j d d  f S(   Nu  bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from.  The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    %s

and your PYTHONPATH environment variable currently contains:

    %r

Here are some of your options for correcting the problem:

* You can choose a different installation directory, i.e., one that is
  on PYTHONPATH or supports .pth files

* You can add the installation directory to the PYTHONPATH environment
  variable.  (It must then also be on PYTHONPATH whenever you run
  Python and want to use the package(s) you are installing.)

* You can set up the installation directory to support ".pth" files by
  using one of the approaches described here:

  https://pythonhosted.org/setuptools/easy_install.html#custom-installation-locations

Please make the appropriate changes for your system and try again.u
   PYTHONPATHu    (   u   install_diru   osu   environu   get(   u   selfu   template(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   no_default_version_msgk  s    u#   easy_install.no_default_version_msgc             C   s?  |  j  r d St j j |  j d  } t d d  } d } t j j |  r t j d |  j  t	 | d  } | j
   } t j d k r | j   } n  | j   | j d	  s t d
 |   q n  | | k r2t j d |  |  j st |  t	 | d  } | j |  | j   n  |  j | g  n  d |  _  d S(   u8   Make sure there's a site.py in the target dir, if neededNu   site.pyu
   setuptoolsu   site-patch.pyu    u   Checking existing site.py in %su   rbi   u   def __boot():u;   %s is not a setuptools-generated site.py; please remove it.u   Creating %su   wb(   i   T(   u   sitepy_installedu   osu   pathu   joinu   install_diru   resource_stringu   existsu   logu   debugu   openu   readu   sysu   version_infou   decodeu   closeu
   startswithu   DistutilsErroru   infou   dry_runu   ensure_directoryu   writeu   byte_compileu   True(   u   selfu   sitepyu   sourceu   currentu   f(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   install_site_py  s2    	
	
u   easy_install.install_site_pyc             C   s   |  j  s d St t j j d   } xc t |  j  D]R \ } } | j |  r5 t j j |  r5 |  j	 d |  t j
 | d  q5 q5 Wd S(   u   Create directories under ~.Nu   ~u   os.makedirs('%s', 0700)i  (   u   useru   convert_pathu   osu   pathu
   expanduseru	   iteritemsu   config_varsu
   startswithu   isdiru   debug_printu   makedirs(   u   selfu   homeu   nameu   path(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   create_home_path  s    	"u   easy_install.create_home_pathu   posixu   install_diru/   $base/lib/python$py_version_short/site-packagesu
   script_diru	   $base/binu   $base/Lib/site-packagesu   $base/Scriptsc             G   s   |  j  d  j } |  j r | j   } |  j | d <|  j j t j |  j  } xH | j	   D]7 \ } } t
 |  | d   d  k r\ t |  | |  q\ q\ Wn  d d l m } xo | D]g } t
 |  |  } | d  k	 r | | |  } t j d k rt j j |  } n  t |  | |  q q Wd  S(   Nu   installu   basei    (   u
   subst_varsu   posix(   u   get_finalized_commandu   config_varsu   prefixu   copyu   INSTALL_SCHEMESu   getu   osu   nameu   DEFAULT_SCHEMEu   itemsu   getattru   Noneu   setattru   distutils.utilu
   subst_varsu   pathu
   expanduser(   u   selfu   attrsu   config_varsu   schemeu   attru   valu
   subst_vars(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   _expand  s     	u   easy_install._expandNT(   u   prefix=Nu   installation prefix(   u   zip-oku   zu   install package as a zipfile(   u   multi-versionu   mu%   make apps have to require() a version(   u   upgradeu   Uu1   force upgrade (searches PyPI for latest versions)(   u   install-dir=u   du   install package to DIR(   u   script-dir=u   su   install scripts to DIR(   u   exclude-scriptsu   xu   Don't install scripts(   u   always-copyu   au'   Copy all needed packages to install dir(   u
   index-url=u   iu    base URL of Python Package Index(   u   find-links=u   fu(   additional URL(s) to search for packages(   u   build-directory=u   bu/   download/extract/build in DIR; keep the results(   u	   optimize=u   Oul   also compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0](   u   record=Nu3   filename in which to record list of installed files(   u   always-unzipu   Zu*   don't install as a zipfile, no matter what(   u
   site-dirs=u   Su)   list of directories where .pth files work(   u   editableu   eu+   Install specified packages in editable form(   u   no-depsu   Nu   don't install dependencies(   u   allow-hosts=u   Hu$   pattern(s) that hostnames must match(   u   local-snapshots-oku   lu(   allow building eggs from local checkouts(   u   versionNu"   print version information and exit(   u   no-find-linksNu9   Don't load find-links defined in packages being installedF(A   u   __name__u
   __module__u   __qualname__u   __doc__u   descriptionu   Trueu   command_consumes_argumentsu   Noneu   user_optionsu   boolean_optionsu   siteu   ENABLE_USER_SITEu	   USER_SITEu   help_msgu   appendu   negative_optu   PackageIndexu   create_indexu   initialize_optionsu   delete_blockersu   finalize_optionsu   _expand_attrsu   expand_basedirsu   expand_dirsu   runu   pseudo_tempnameu   warn_deprecated_optionsu   check_site_diru   cant_write_to_targetu   check_pth_processingu   install_egg_scriptsu
   add_outputu   not_editableu   check_editableu   Falseu   easy_installu   install_itemu   select_schemeu   process_distributionu   should_unzipu
   maybe_moveu   install_wrapper_scriptsu   install_scriptu   write_scriptu   install_eggsu   egg_distributionu   install_eggu   install_exeu
   exe_to_eggu   installation_reportu   report_editableu	   run_setupu   build_and_installu   _set_fetcher_optionsu
   update_pthu   unpack_progressu   unpack_and_compileu   byte_compileu   no_default_version_msgu   install_site_pyu   create_home_pathu   dictu   INSTALL_SCHEMESu   DEFAULT_SCHEMEu   _expand(   u
   __locals__(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   easy_install_   s        		3
	*'0
)$	/	(!*2$$
	c           	   C   s  d d   t  j j d d  j t  j  D }  t j g } t j t j k r_ | j t j  n  x8| D]0} | rf t j	 d k r |  j t  j
 j | d d   n t  j d	 k r |  j t  j
 j | d
 d t j d  d  d  t  j
 j | d
 d  g  n% |  j | t  j
 j | d
 d  g  t j	 d k rd | k rt  j j d  } | r|  j t  j
 j | d d t j d  d  d   qqqqf qf Wt d  t d  f } x* | D]" } | |  k r|  j |  qqWt j r|  j t j  n  t t t |    }  |  S(   Nc             S   s   g  |  ] } | r |  q S(    (    (   u   .0u   _f(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu
   <listcomp>  s   	 u!   get_site_dirs.<locals>.<listcomp>u
   PYTHONPATHu    u   os2emxu   riscosu   Libu   site-packagesu   /u   libu   pythoni   u   site-pythonu   darwinu   Python.frameworku   HOMEu   Libraryu   Pythonu   purelibu   platlib(   u   os2emxu   riscos(   u   osu   environu   getu   splitu   pathsepu   sysu   prefixu   exec_prefixu   appendu   platformu   pathu   joinu   sepu   extendu   versionu   get_pathu   siteu   ENABLE_USER_SITEu	   USER_SITEu   listu   mapu   normalize_path(   u   sitedirsu   prefixesu   prefixu   homeu	   lib_pathsu   site_lib(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   get_site_dirs  sF    " 	u   get_site_dirsc             c   s^  i  } xQ|  D]I} t  |  } | | k r1 q n  d | | <t j j |  sS q n  t j |  } | | f Vx | D] } | j d  s qt n  | d k r qt n  t t j j | |   } t t	 |   } | j
   xw | D]o } | j d  s t  | j    } | | k rNd | | <t j j |  s4q n  | t j |  f VqNq q Wqt Wq Wd S(   uB   Yield sys.path directories that might contain "old-style" packagesi   u   .pthu   easy-install.pthu   setuptools.pthu   importN(   u   easy-install.pthu   setuptools.pth(   u   normalize_pathu   osu   pathu   isdiru   listdiru   endswithu   openu   joinu   listu   yield_linesu   closeu
   startswithu   rstrip(   u   inputsu   seenu   dirnameu   filesu   nameu   fu   linesu   line(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   expand_paths  s4    


u   expand_pathsc             C   s  t  |  d  } zt j |  } | d k r1 d S| d | d | d } | d k  r[ d S| j | d  d d l m } m } d d l } | j	 d	 | j
 d   \ } } }	 | d k r d S| j | d |  | j i d d 6d d 6 }
 y~ | j
 |  } t j d k r't d g  } n t d  } | j | d  d } | j t j    } |
 j | |   Wn | j k
 rd SYn X|
 j d  s|
 j d  rd S|
 SWd | j   Xd S(   un   Extract configuration data from a bdist_wininst .exe

    Returns a ConfigParser.RawConfigParser, or None
    u   rbi	   i   i   i   i    (   u   StringIOu   ConfigParserNu   <iiiizV4i{V4u    u   versionu   target_versioni   i   u   metadatau   Setup(   izV4i{V4(   i   i   (   u   openu   zipfileu   _EndRecDatau   Noneu   seeku   setuptools.compatu   StringIOu   ConfigParseru   structu   unpacku   readu   RawConfigParseru   sysu   version_infou   bytesu   chru   splitu   decodeu   getfilesystemencodingu   readfpu   Erroru   has_sectionu   close(   u   dist_filenameu   fu   endrecu	   prependedu   StringIOu   ConfigParseru   structu   tagu   cfglenu   bmlenu   cfgu   partu	   null_byteu   config(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   extract_wininst_cfg0  s<    $	 c             C   s  d d d d d g } t  j |   } z}xv| j   D]h} | j } | j d  } t |  d	 k r | d
 d k r | d j d  r | j d d j | d d
   d f  Pq n  t |  d
 k s4 | j d  r q4 n  | j d  r q4 n  | d j	   d k r4 | j
 |  } t j d  k r7| j   } n  xb t |  D]Q } | j   j d d  } | j d  sD| j d | d | f d f  qDqDWq4 q4 WWd | j   Xd d   | D } | j   | j   | S(!   u4   Get exe->egg path translations for a given .exe fileu   PURELIB/u    u   PLATLIB/pywin32_system32u   PLATLIB/u   SCRIPTS/u   EGG-INFO/scripts/u   DATA/lib/site-packagesu   /i   i   u   PKG-INFOi   u	   .egg-infoi    Nu	   EGG-INFO/u   .pthu
   -nspkg.pthu   PURELIBu   PLATLIBu   \u   importu   %s/%s/c             S   s(   g  |  ] \ } } | j    | f  q S(    (   u   lower(   u   .0u   xu   y(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu
   <listcomp>  s   	 u$   get_exe_prefixes.<locals>.<listcomp>(   u   PURELIB/u    (   u   PLATLIB/pywin32_system32u    (   u   PLATLIB/u    (   u   SCRIPTS/u   EGG-INFO/scripts/(   u   DATA/lib/site-packagesu    (   u   PURELIBu   PLATLIB(   i   (   u   zipfileu   ZipFileu   infolistu   filenameu   splitu   lenu   endswithu   insertu   joinu   upperu   readu   sysu   version_infou   decodeu   yield_linesu   stripu   replaceu
   startswithu   appendu   closeu   sortu   reverse(   u   exe_filenameu   prefixesu   zu   infou   nameu   partsu   contentsu   pth(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   get_exe_prefixes_  s<    		")"3

c             C   s=   y t  j |   SWn% t k
 r8 t d |  f   Yn Xd  S(   Nu1   Not a URL, existing file, or requirement spec: %r(   u   Requirementu   parseu
   ValueErroru   DistutilsError(   u   spec(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   parse_requirement_arg  s
    u   parse_requirement_argc             B   sk   |  Ee  Z d  Z d Z d Z f  d d  Z d d   Z d d   Z d d	   Z	 d
 d   Z
 d d   Z d S(   u   PthDistributionsu)   A .pth file with Distribution paths in itc             C   s   | |  _  t t t |   |  _ t t j j |  j    |  _ |  j	   t
 j |  g  d  d   x6 t |  j  D]% } t t |  j t | d    qo Wd  S(   NT(   u   filenameu   listu   mapu   normalize_pathu   sitedirsu   osu   pathu   dirnameu   basediru   _loadu   Environmentu   __init__u   Noneu   yield_linesu   pathsu   addu   find_distributionsu   True(   u   selfu   filenameu   sitedirsu   path(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   __init__  s    	
u   PthDistributions.__init__c             C   s  g  |  _  d } t j |  j  } t j j |  j  r3t	 |  j d  } x | D] } | j
 d  rp d } qO n  | j   } |  j  j |  | j   sO | j   j
 d  r qO n  t t j j |  j |   } |  j  d <t j j |  s | | k r|  j  j   d |  _ qO n  d | | <qO W| j   n  |  j  rO| rOd |  _ n  x. |  j  r|  j  d j   r|  j  j   qRWd  S(	   Nu   rtu   importu   #i   FTii(   u   pathsu   Falseu   dictu   fromkeysu   sitedirsu   osu   pathu   isfileu   filenameu   openu
   startswithu   Trueu   rstripu   appendu   stripu   normalize_pathu   joinu   basediru   existsu   popu   dirtyu   close(   u   selfu
   saw_importu   seenu   fu   lineu   path(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   _load  s2    	"&	 u   PthDistributions._loadc             C   s   |  j  s d Sd j t |  j |  j   } | r t j d |  j  d | } t j	 j
 |  j  rv t j |  j  n  t |  j d  } | j |  | j   n; t j	 j |  j  r t j d |  j  t j |  j  n  d |  _  d S(   u$   Write changed .pth file back to diskNu   
u	   Saving %su   import sys; sys.__plen = len(sys.path)
%s
import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:]; p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert = p+len(new)
u   wtu   Deleting empty %sF(   u   dirtyu   joinu   mapu   make_relativeu   pathsu   logu   debugu   filenameu   osu   pathu   islinku   unlinku   openu   writeu   closeu   existsu   False(   u   selfu   datau   f(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   save  s     	u   PthDistributions.savec             C   sl   | j  |  j k rX | j  |  j k s9 | j  t j   k rX |  j j | j   d |  _ n  t j	 |  |  d S(   u"   Add `dist` to the distribution mapNT(
   u   locationu   pathsu   sitedirsu   osu   getcwdu   appendu   Trueu   dirtyu   Environmentu   add(   u   selfu   dist(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   add  s    u   PthDistributions.addc             C   sI   x2 | j  |  j k r4 |  j j | j   d |  _ q Wt j |  |  d S(   u'   Remove `dist` from the distribution mapNT(   u   locationu   pathsu   removeu   Trueu   dirtyu   Environment(   u   selfu   dist(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   remove  s    u   PthDistributions.removec             C   s   t  j j t |   \ } } t |  j  } | g } t  j d k rK d pQ t  j } xu t |  | k r | |  j k r | j t  j	  | j
   | j |  St  j j |  \ } } | j |  qW W| Sd  S(   Nu   /(   u   osu   pathu   splitu   normalize_pathu   lenu   basediru   altsepu   sepu   appendu   curdiru   reverseu   join(   u   selfu   pathu   npathu   lastu   baselenu   partsu   sep(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   make_relative  s    	
u   PthDistributions.make_relativeNF(   u   __name__u
   __module__u   __qualname__u   __doc__u   Falseu   dirtyu   __init__u   _loadu   saveu   addu   removeu   make_relative(   u
   __locals__(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   PthDistributions  s   	
c             C   s/  d d l  m } t | j t  s= t j | j j    } n  |  d j   d } | j	 |  } d } | r | j
 d  p~ d } | r d | } q n  | r d } n t |  } d t   } t |  s| r| j   j d	  rd
 | j   d d  } qqd
 } n  t | |  } d t   } | S(   u;   Create a #! line, getting options (if any) from script_texti    (   u   first_line_reu   
u    i   u    u
   python.exeu   #!%(executable)s%(options)s
u   -u    -xN(   u   distutils.command.build_scriptsu   first_line_reu
   isinstanceu   patternu   stru   reu   compileu   decodeu
   splitlinesu   matchu   groupu   nt_quote_argu   localsu   isasciiu   stripu
   startswithu   fix_jython_executable(   u   script_textu
   executableu   wininstu   first_line_reu   firstu   matchu   optionsu   hdr(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   get_script_header  s,     	 	u   get_script_headerc             C   sz   |  t  j k r8 t  j d k r8 t | t j  |  |  St j   \ } } } t | | d | d d |  | f f  d  S(   Nu   nti    i   u    %s %s(	   u   osu   removeu   nameu   chmodu   statu   S_IWRITEu   sysu   exc_infou   reraise(   u   funcu   argu   excu   etu   evu   _(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu
   auto_chmod  s
    
u
   auto_chmodc             C   s1   d d l  m } t |  |  t |  t j  d S(   u?   Ensure that the importer caches dont have stale info for `path`i    (   u   _zip_directory_cacheN(   u	   zipimportu   _zip_directory_cacheu   _uncacheu   sysu   path_importer_cache(   u   pathu   zdc(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   uncache_zipdir  s    u   uncache_zipdirc             C   sT   |  | k r | |  =n: t  |   }  x+ | D]# } t  |  |  k r) | | =d  Sq) Wd  S(   N(   u   normalize_path(   u   pathu   cacheu   p(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   _uncache#  s    
u   _uncacheu   <string>c             C   s;   y t  |  | d  Wn t t f k
 r2 d SYn Xd Sd S(   u%   Is this string a valid Python script?u   execNFT(   u   compileu   SyntaxErroru	   TypeErroru   Falseu   True(   u   textu   filename(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu	   is_python-  s
    	u	   is_pythonc             C   sR   y) t  |   } | j d  } | j   Wn t t f k
 rG |  SYn X| d k S(   uC   Determine if the specified executable is a .sh (contains a #! line)i   u   #!(   u   openu   readu   closeu   OSErroru   IOError(   u
   executableu   fpu   magic(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   is_sh6  s     	u   is_shc             C   s  g  } d
 } d } d |  k p' d |  k } | r@ | j d  n  x |  D]z } | d k rf | d 7} qG | d k r | j d | d d  d } qG | r | j d |  d } n  | j |  qG W| r | j d |  n  | r| j d |  | j d  n  d	 j |  S(   u@   Quote a command line argument according to Windows parsing rulesi    u    u   	u   "u   \i   i   u   \"u    F(   u   Falseu   appendu   join(   u   argu   resultu	   needquoteu   nbu   c(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   nt_quote_arg?  s,    		u   nt_quote_argc             C   sb   | j  d  s | j  d  r" d St |  |  r5 d S|  j d  r^ d |  j   d j   k Sd S(   uM   Is this text, as a whole, a Python script? (as opposed to shell/bat/etc.
    u   .pyu   .pywu   #!u   pythoni    TF(   u   endswithu   Trueu	   is_pythonu
   startswithu
   splitlinesu   loweru   False(   u   script_textu   filename(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   is_python_script`  s    u   is_python_script(   u   chmodc              G   s   d  S(   N(    (   u   args(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   _chmodq  s    u   _chmodc             C   s`   t  j d |  |  y t |  |  Wn5 t j k
 r[ t j   d } t  j d |  Yn Xd  S(   Nu   changing mode of %s to %oi   u   chmod failed: %s(   u   logu   debugu   _chmodu   osu   erroru   sysu   exc_info(   u   pathu   modeu   e(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   chmods  s    u   chmodc             C   sn   t  j j d  rj t |   rj d d  l } | j j j d  d k rI |  S| r_ t j	 d  qj d |  Sn  |  S(   Nu   javai    u   os.nameu   Linuxu   WARNING: Unable to adapt shebang line for Jython, the following script is NOT executable
         see http://bugs.jython.org/issue1112 for more information.u   /usr/bin/env %s(
   u   sysu   platformu
   startswithu   is_shu   javau   langu   Systemu   getPropertyu   logu   warn(   u
   executableu   optionsu   java(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   fix_jython_executable{  s    
u   fix_jython_executablec             B   sk   |  Ee  Z d  Z d Z e j d  j   Z e e	 d
 d d   Z e d d    Z e d d    Z d	 S(   u   ScriptWriteru`   
    Encapsulates behavior around writing entry point scripts for console and
    gui apps.
    u6  
        # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r
        __requires__ = %(spec)r
        import sys
        from pkg_resources import load_entry_point

        if __name__ == '__main__':
            sys.exit(
                load_entry_point(%(spec)r, %(group)r, %(name)r)()
            )
    c             c   s   |  j  |  } t | j    } t d | |  } xv d D]n } | d } x[ | j |  j   D]D \ }	 }
 | j t   } x% | j | |	 | |  D] } | Vq Wq` Wq: Wd S(   uW   
        Yield write_script() argument tuples for a distribution's entrypoints
        u    u   consoleu   guiu   _scriptsN(   u   consoleu   gui(	   u
   get_writeru   stru   as_requirementu   get_script_headeru   get_entry_mapu   itemsu   templateu   localsu   _get_script_args(   u   clsu   distu
   executableu   wininstu	   gen_classu   specu   headeru   type_u   groupu   nameu   epu   script_textu   res(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   get_script_args  s    
"u   ScriptWriter.get_script_argsc             C   s#   | s t  j d k r t j   S|  S(   Nu   win32(   u   sysu   platformu   WindowsScriptWriteru
   get_writer(   u   clsu   force_windows(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu
   get_writer  s    
u   ScriptWriter.get_writerc             c   s   | | | f Vd  S(   N(    (   u   clsu   type_u   nameu   headeru   script_text(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   _get_script_args  s    u   ScriptWriter._get_script_argsNF(   u   __name__u
   __module__u   __qualname__u   __doc__u   textwrapu   dedentu   lstripu   templateu   classmethodu   sys_executableu   Falseu   get_script_argsu
   get_writeru   _get_script_args(   u
   __locals__(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   ScriptWriter  s   
u   ScriptWriterc             B   sJ   |  Ee  Z d  Z e d d    Z e d d    Z e d d    Z d S(   u   WindowsScriptWriterc             C   s2   t  d t d |   } t j j d d  } | | S(   u:   
        Get a script writer suitable for Windows
        u
   executableu   naturalu   SETUPTOOLS_LAUNCHER(   u   dictu   WindowsExecutableLauncherWriteru   osu   environu   get(   u   clsu   writer_lookupu   launcher(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu
   get_writer  s
    	u   WindowsScriptWriter.get_writerc             #   s   t  d d d d  | } | t j d j   j d  k rR t j d | t  n  d d d	 d
 d d d g } | j |  |  j	 | |  }   f d d   | D }   | | | d | f Vd S(   u    For Windows, add a .py extensionu   consoleu   .pyau   guiu   .pywu   PATHEXTu   ;uH   %s not listed in PATHEXT; scripts will not be recognized as executables.u   .pyu
   -script.pyu   .pycu   .pyou   .exec                s   g  |  ] }   |  q S(    (    (   u   .0u   x(   u   name(    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu
   <listcomp>  s   	 u8   WindowsScriptWriter._get_script_args.<locals>.<listcomp>u   tN(
   u   dictu   osu   environu   loweru   splitu   warningsu   warnu   UserWarningu   removeu   _adjust_header(   u   clsu   type_u   nameu   headeru   script_textu   extu   oldu   blockers(    (   u   nameu8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   _get_script_args  s    "	u$   WindowsScriptWriter._get_script_argsc             C   s   d } d } |  d k r( | | } } n  t  j t  j |  t  j  } | j d | d |  } | d d
  j d  } t j d	 k r t j	 j
 |  r | S| S(   u   
        Make sure 'pythonw' is used for gui and and 'python' is used for
        console (regardless of what sys.executable is).
        u   pythonw.exeu
   python.exeu   guiu   stringu   repli   i   u   "u   win32i(   u   reu   compileu   escapeu
   IGNORECASEu   subu   stripu   sysu   platformu   osu   pathu   exists(   u   type_u   orig_headeru   patternu   replu
   pattern_obu
   new_headeru   clean_header(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   _adjust_header  s    "u"   WindowsScriptWriter._adjust_headerN(   u   __name__u
   __module__u   __qualname__u   classmethodu
   get_writeru   _get_script_argsu   staticmethodu   _adjust_header(   u
   __locals__(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   WindowsScriptWriter  s   u   WindowsScriptWriterc             B   s&   |  Ee  Z d  Z e d d    Z d S(   u   WindowsExecutableLauncherWriterc             #   s   | d k r$ d } d } d g } n d } d } d d d g } |  j  | |  }   f d	 d
   | D }	   | | | d |	 f V  d t |  d f Vt   s   d }
 |
 t    d f Vn  d S(   uG   
        For Windows, add a .py extension and an .exe launcher
        u   guiu   -script.pywu   .pywu   cliu
   -script.pyu   .pyu   .pycu   .pyoc                s   g  |  ] }   |  q S(    (    (   u   .0u   x(   u   name(    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu
   <listcomp>  s   	 uD   WindowsExecutableLauncherWriter._get_script_args.<locals>.<listcomp>u   tu   .exeu   bu   .exe.manifestN(   u   _adjust_headeru   get_win_launcheru   is_64bitu   load_launcher_manifest(   u   clsu   type_u   nameu   headeru   script_textu   launcher_typeu   extu   oldu   hdru   blockersu   m_name(    (   u   nameu8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   _get_script_args  s    	
u0   WindowsExecutableLauncherWriter._get_script_argsN(   u   __name__u
   __module__u   __qualname__u   classmethodu   _get_script_args(   u
   __locals__(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   WindowsExecutableLauncherWriter  s   u   WindowsExecutableLauncherWriterc             C   st   d |  } t  j   j   d k r7 | j d d  } n  t   rU | j d d  } n | j d d  } t d |  S(   u   
    Load the Windows launcher (executable) suitable for launching a script.

    `type` should be either 'cli' or 'gui'

    Returns the executable as a byte string.
    u   %s.exeu   armu   .u   -arm.u   -64.u   -32.u
   setuptools(   u   platformu   machineu   loweru   replaceu   is_64bitu   resource_string(   u   typeu   launcher_fn(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   get_win_launcher  s    
	u   get_win_launcherc             C   sH   t  j t d  } t j d d k  r0 | t   S| j d  t   Sd  S(   Nu   launcher manifest.xmli    i   u   utf-8(   u   pkg_resourcesu   resource_stringu   __name__u   sysu   version_infou   varsu   decode(   u   nameu   manifest(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   load_launcher_manifest  s    u   load_launcher_manifestc             C   s~  | r d d   } n | d k r0 d d   } n  g  } y t j |   } Wn. t j k
 ry | t j |  t j    Yn Xx | D] } t j j |  |  } y t j |  j	 } Wn t j k
 r d } Yn Xt
 j |  r t | | |  q y t j |  Wq t j k
 r3| t j | t j    Yq Xq Wy t j |   Wn. t j k
 ry| t j |  t j    Yn Xd S(   u   Recursively delete a directory tree.

    This code is taken from the Python 2.4 version of 'shutil', because
    the 2.3 version doesn't really work right.
    c              W   s   d  S(   N(    (   u   args(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   onerror,  s    u   rmtree.<locals>.onerrorc              W   s     d  S(   N(    (   u   args(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   onerror/  s    i    N(   u   Noneu   osu   listdiru   erroru   sysu   exc_infou   pathu   joinu   lstatu   st_modeu   statu   S_ISDIRu   rmtreeu   removeu   rmdir(   u   pathu   ignore_errorsu   onerroru   namesu   nameu   fullnameu   mode(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   rmtree%  s2    "u   rmtreec              C   s    t  j d  }  t  j |   |  S(   Ni   (   u   osu   umask(   u   tmp(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   current_umaskH  s    u   current_umaskc              C   sM   d d  l  }  t j j |  j d  } | t j d <t j j |  t   d  S(   Ni    (	   u
   setuptoolsu   osu   pathu   dirnameu   __path__u   sysu   argvu   appendu   main(   u
   setuptoolsu   argv0(    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu	   bootstrapM  s
    u	   bootstrapc                s   d d l  m  d d l m   d d  l  d   f d d      f d d    G   f d	 d
   d
      d  k r t j d d    n       f d d    d  S(   Ni    (   u   setup(   u   DistributionuL   usage: %(script)s [options] requirement_or_url ...
   or: %(script)s --help
c                s     t  d t j j |    S(   Nu   script(   u   dictu   osu   pathu   basename(   u   script_name(   u   USAGE(    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu	   gen_usage_  s    	u   main.<locals>.gen_usagec                s7     j  j } z    j  _ |    SWd  |   j  _ Xd  S(   N(   u   coreu	   gen_usage(   u   fu   old_gen_usage(   u	   distutilsu	   gen_usage(    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   with_ei_usaged  s
    u   main.<locals>.with_ei_usagec                s/   |  Ee  Z d  Z d Z    f d d   Z d S(   u-   main.<locals>.DistributionWithoutHelpCommandsu    c                s#         f d d    d  S(   Nc                  s     j      S(   N(   u
   _show_help(    (   u   Distributionu   argsu   kwu   self(    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   <lambda>p  s    uJ   main.<locals>.DistributionWithoutHelpCommands._show_help.<locals>.<lambda>(    (   u   selfu   argsu   kw(   u   Distributionu   with_ei_usage(   u   argsu   kwu   selfu8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu
   _show_helpo  s    u8   main.<locals>.DistributionWithoutHelpCommands._show_helpN(   u   __name__u
   __module__u   __qualname__u   common_usageu
   _show_help(   u
   __locals__(   u   Distributionu   with_ei_usage(    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   DistributionWithoutHelpCommandsl  s   u   DistributionWithoutHelpCommandsi   c            	      s6    d d d d g  d t  j d p) d d     S(   Nu   script_argsu   -qu   easy_installu   -vu   script_namei    u	   distclass(   u   sysu   argv(    (   u   DistributionWithoutHelpCommandsu   argvu   kwu   setup(    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   <lambda>u  s    u   main.<locals>.<lambda>(   u
   setuptoolsu   setupu   setuptools.distu   Distributionu   distutils.coreu   Noneu   sysu   argv(   u   argvu   kw(    (	   u   Distributionu   DistributionWithoutHelpCommandsu   USAGEu   argvu	   distutilsu	   gen_usageu   kwu   setupu   with_ei_usageu8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   mainU  s    (r   u   __doc__u   sysu   osu	   zipimportu   shutilu   tempfileu   zipfileu   reu   statu   randomu   platformu   textwrapu   warningsu   siteu   structu   globu	   distutilsu   logu   dir_utilu   pkg_resourcesu
   setuptoolsu   Commandu   _dont_write_bytecodeu   setuptools.sandboxu	   run_setupu   setuptools.py31compatu   get_pathu   get_config_varsu   distutils.utilu   get_platformu   convert_pathu
   subst_varsu   distutils.errorsu   DistutilsArgErroru   DistutilsOptionErroru   DistutilsErroru   DistutilsPlatformErroru   distutils.command.installu   INSTALL_SCHEMESu   SCHEME_KEYSu   setuptools.commandu   setoptu   setuptools.archive_utilu   unpack_archiveu   setuptools.package_indexu   PackageIndexu
   URL_SCHEMEu	   bdist_eggu   egg_infou   setuptools.compatu	   iteritemsu   maxsizeu
   basestringu   unicodeu   reraiseu   yield_linesu   normalize_pathu   resource_stringu   ensure_directoryu   get_distributionu   find_distributionsu   Environmentu   Requirementu   Distributionu   PathMetadatau   EggMetadatau
   WorkingSetu   DistributionNotFoundu   VersionConflictu   DEVELOP_DISTu   environu   getu   pathu   normpathu
   executableu   sys_executableu   __all__u   is_64bitu   samefileu   version_infou	   _to_asciiu   isasciiu   easy_installu   get_site_dirsu   expand_pathsu   extract_wininst_cfgu   get_exe_prefixesu   parse_requirement_argu   PthDistributionsu   Falseu   get_script_headeru
   auto_chmodu   uncache_zipdiru   _uncacheu	   is_pythonu   is_shu   nt_quote_argu   is_python_scriptu   chmodu   _chmodu   ImportErroru   fix_jython_executableu   objectu   ScriptWriteru   WindowsScriptWriteru   WindowsExecutableLauncherWriteru   get_script_argsu   get_win_launcheru   load_launcher_manifestu   rmtreeu   current_umasku	   bootstrapu   Noneu   main(    (    (    u8   /tmp/pip-k8wh6o-build/setuptools/command/easy_install.pyu   <module>   s   "(d	    ~.)/&j
		!..	#