σ
@K7]c           @` sΈ   d  d l  m Z m Z m Z d  d l Z d  d l Z d  d l Z d  d l m Z d  d l	 m
 Z
 m Z d  d l m Z d  d l m Z e j d e j  d   Z d	   Z d
   Z d S(   i    (   t   absolute_importt   divisiont   print_functionN(   t   api(   t   CONDA_TARBALL_EXTENSIONSt   on_win(   t   get_render_parser(   t   executet   levelc         C` sU  t    } d | _ | j d d d | j d d d d | j d d	 d d
 | j d d d d d d | j d  d g  | j D] } | j d g k r | ^ q d f g  | j d  d g  | j D] } | j d g k rΘ | ^ qΘ d f g  | j d  d g  | j D] } | j d g k r| ^ qd f g  | j |   }  | |  f S(   NsQ   

Set up environments and activation scripts to debug your build or test phase.

t   recipe_or_package_file_patht   helpsτ   Path to recipe directory or package file to use for dependency and source information. If you use a recipe, you get the build/host env and source work directory.  If you use a package file, you get the test environments and the test_tmp folder.s   -ps   --paths‘   root path in which to place envs, source and activation script.  Defaults to a standard conda-build work folder (packagename_timestamp) in your conda-bld folder.s   -os   --output-idsψ   fnmatch pattern that is associated with the output that you want to create an env for.  Must match only one file, as we don't support creating envs for more than one output at a time. The top-level recipe can be specified by passing 'TOPLEVEL' heres   -as   --activate-string-onlyt   actiont
   store_truesu   Output only the string to the used generated activation script.  Use this for creating envs in scripted environments.s   --outputi    s   --bootstraps   --old-build-string(   R   t   descriptiont   add_argumentt   _handle_conflict_resolvet   Nonet   _actionst   option_stringst
   parse_args(   t   argst   pt   _(    (    s9   lib/python2.7/site-packages/conda_build/cli/main_debug.pyR      s"    		EE)c         ` s`  t  |   \ }   t } yt   f d   t D  sR t |  d t } t } n	   j } t j | d   j	   j
 }   j	 s± t d d  | r€ t d  q± t d  n  t |    j	 s(| rς t rΦ d n d } t d	 j |   n% t rώ d
 n d } t d j |   t d d  n  Wn0 t k
 r[} t t |   t j d  n Xd  S(   Nc         3` s.   |  ]$ } t  j j   j  d  | k Vq d S(   i   N(   t   ost   patht   splitextR	   (   t   .0t   ext(   t   _args(    s9   lib/python2.7/site-packages/conda_build/cli/main_debug.pys	   <genexpr>@   s    t   print_resultst   verboset   #iP   sK   Test environment created for debugging.  To enter a debugging environment:
sY   Build and/or host environments created for debugging.  To enter a debugging environment:
s   conda_test_runner.shsD   To run your tests, you might want to start with running the {} file.s   conda_build.bats   conda_build.shsD   To run your build, you might want to start with running the {} file.i   (   R   t   Truet   anyR   t   render_executet   FalseR	   R   t   debugt   activate_string_onlyt   __dict__t   printR   t   formatt
   ValueErrort   strt   syst   exit(   R   R   t   testt   thing_to_debugt   activation_stringt	   test_filet
   build_filet   e(    (   R   s9   lib/python2.7/site-packages/conda_build/cli/main_debug.pyR   ;   s0    			
	c           C` s   t  t j d  S(   Ni   (   R   R+   t   argv(    (    (    s9   lib/python2.7/site-packages/conda_build/cli/main_debug.pyt   main]   s    (   t
   __future__R    R   R   t   loggingR   R+   t   conda_buildR   t   conda_build.utilsR   R   t   conda_build.cli.main_renderR   R   R"   t   basicConfigt   INFOR   R4   (    (    (    s9   lib/python2.7/site-packages/conda_build/cli/main_debug.pyt   <module>   s   	#	"