ó
z]8Rc           @   sÛ  d  Z  d d l Z d d l Z d d l Z d d l Z d d l m Z e j ƒ  Z d Z	 e d e	 ƒ Z
 e
 j d d d d	 ƒe
 j d
 d d d d d d e d d ƒe
 j d d d d ƒe
 j d d d d ƒe
 j ƒ  \ Z Z e Z y d d l Z d d l Z Wnä e k
 rëi  Z y d d l m Z Wn! e k
 rRd d l m Z n Xe d ƒ j ƒ  e f d Ue d e d d ƒ Z e d e   e r£e e ƒ n  d d l Z x: e j D]+ Z e e j j k r¹e j j e ƒ q¹q¹Wn Xe j Z  e j! d d d e g Z" e j# j$ d  e j% p4e j& r1d! n d ƒ Z% e% rVe" j( d e% g ƒ n  e  j) e j* j+ d" ƒ ƒ j, Z- d# Z. e j/ Z/ e/ d k r´e j& r´d d l0 Z d/ Z1 d& „  Z2 e j3 j4 d' e- g ƒ Z5 e% råe5 j6 e% f ƒ n  e j* j+ e. ƒ Z7 e5 j8 e7 ƒ d k	 r´g  Z9 d Z: xs e5 e7 j; D]d Z< e< j= Z> e2 e> ƒ r&e: d k sYe> e: k rke< g Z9 e> Z: qŠe> e: k rŠe9 j? e< ƒ qŠq&q&We9 r±e9 j@ ƒ  e9 d j/ Z/ q±q´n  e/ rÒd( jA e. e/ f ƒ Z. n  e" j? e. ƒ d d lB ZB eB jC e" d) e e j# d* e- ƒƒd k r4eD d+ eE e" ƒ d, d !ƒ ‚ n  e  j e ƒ e  jF e. ƒ d d lG ZH g  e D] ZI d- eI k raeI ^ qase j? d. ƒ n  e jJ d k	 r·d e jJ g e d d +n  eH jK jK jL e ƒ e jM e ƒ d S(0   sà   Bootstrap a buildout-based project

Simply run this script in a directory containing a buildout.cfg.
The script accepts buildout command-line options, so you can
use the -c option to specify an alternate configuration file.
iÿÿÿÿN(   t   OptionParsersF  [DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options]

Bootstraps a buildout-based project.

Simply run this script in a directory containing a buildout.cfg, using the
Python that you want bin/buildout to use.

Note that by using --find-links to point to local resources, you can keep 
this script from going over the network.
t   usages   -vs	   --versiont   helps"   use a specific zc.buildout versions   -ts   --accept-buildout-test-releasest   destt   accept_buildout_test_releasest   actiont
   store_truet   defaults  Normally, if you do not specify a --version, the bootstrap script and buildout gets the newest *final* versions of zc.buildout and its recipes and extensions for you.  If you use this flag, bootstrap and buildout will get the newest releases even if they are alphas or betas.s   -cs   --config-files?   Specify the path to the buildout configuration file to be used.s   -fs   --find-linkss-   Specify a URL to search for buildout releases(   t   urlopens;   https://bitbucket.org/pypa/setuptools/raw/0.7.2/ez_setup.pyt   to_dirt   download_delayi    t   use_setuptoolss8   from setuptools.command.easy_install import main; main()s   -mZqNxds   bootstrap-testing-find-linkss   http://downloads.buildout.org/t
   setuptoolss   zc.buildouts   *final-s   *finalc         C   s5   x. |  D]& } | d  d k r | t  k r t Sq Wt S(   Ni   t   *(   t   _final_partst   Falset   True(   t   parsed_versiont   part(    (    s*   /Users/tkomiya/work/blockdiag/bootstrap.pyt   _final_versiony   s    t   search_paths   ==t   envt
   PYTHONPATHs   Failed to execute command:
%si   t   =t	   bootstrap(   s   *final-s   *final(N   t   __doc__t   ost   shutilt   syst   tempfilet   optparseR    t   mkdtempt   tmpeggsR   t   parsert
   add_optionR   t
   parse_argst   optionst   argst	   to_reloadt   pkg_resourcesR   t   ImportErrort   ezt   urllib.requestR   t   urllib2t   readt   dictt
   setup_argst   reloadt   patht   working_sett   entriest	   add_entryt   wst
   executablet   cmdt   environt   gett
   find_linksR   t   Nonet   extendt   findt   Requirementt   parset   locationt   setuptools_patht   requirementt   versiont   setuptools.package_indexR   R   t   package_indext   PackageIndext   indext   add_find_linkst   reqt   obtaint   bestt   bestvt   project_namet   distR   t   distvt   appendt   sortt   joint
   subprocesst   callt	   Exceptiont   reprt   requiret   zc.buildout.buildoutt   zct   at   config_filet   buildoutt   maint   rmtree(    (    (    s*   /Users/tkomiya/work/blockdiag/bootstrap.pyt   <module>   s¸   									
*%