ó
á™xTc           @   s�   d  d l  m Z d  d l m Z m Z d  d l m Z d  d l Z d  d l	 Z	 d  d l
 Z
 d „  Z d „  Z d „  Z e d k r‹ e ƒ  n  d S(	   iÿÿÿÿ(   t   division(   t   Sorryt   show_times_at_exit(   t   show_stringNc          C   sä   t  j j }  t  j j } t j j d  k	 r} t j j d } | j ƒ  rP t | ƒ St j j d d } | j ƒ  r} t | ƒ Sn  x` t j j	 D]R } | d d } | j ƒ  r´ t | ƒ S| d d d } | j ƒ  rŠ t | ƒ SqŠ Wd  S(   Nt   enginet   srct   scons(
   t   ost   patht   joint   isdirt   libtbxt   envt   scons_dist_patht   Nonet   abst   repository_paths(   R	   R
   t   resultR   (    (    sG   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/command_line/scons.pyt   find_scons_engine_path   s"     
  
 c           C   s   d  S(   N(    (    (    (    sG   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/command_line/scons.pyt   dummy_fetch_win32_parallel_msg   s    c             si  d t  j d k ‰  ‡  f d †  }  t ƒ  } | d  k	 r‚ t  j j d | ƒ y d d  l } Wq‚ t k
 r~ |  ƒ  t  j d =q‚ Xn  y d d  l } Wn‰ t k
 r|  ƒ  d d d g } x1 t	 j
 j D]# } | j d	 t t | ƒ ƒ ƒ qÅ W| j d
 d d d g ƒ t d j | ƒ ƒ ‚ n Xd d  l } t | j j d ƒ rQt | j j _ n  t ƒ  | j j ƒ  d  S(   Ns   --debug=importi   c             s1   ˆ  r- d d  l  }  t j J|  j ƒ  t j Jn  d  S(   Niÿÿÿÿ(   t	   tracebackt   syst   stderrt	   print_exc(   R   (   t   debug_import(    sG   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/command_line/scons.pyt   show_traceback   s
    
i    iÿÿÿÿs   SCons is not available.s:     A possible solution is to unpack a SCons distribution ins     one of these directories:s       s5     SCons distributions are available at this location:s       http://www.scons.org/s@     It may be necessary to rename the unpacked distribution, e.g.:s       mv scons-0.96.1 sconss   
t   fetch_win32_parallel_msg(   R   t   argvR   R   R   t   insertt   SConst   ImportErrort   SCons.ScriptR   R   R   t   appendR   R   t   extendR   R	   t   SCons.Script.Maint   hasattrt   Scriptt   MainR   R   R   t   main(   R   t   engine_pathR   t   msgR   (    (   R   sG   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/command_line/scons.pyt   run   s<    	  	!
t   __main__(   t
   __future__R    t   libtbx.utilsR   R   t   libtbx.str_utilsR   t   libtbx.load_envR   R   R   R   R   R)   t   __name__(    (    (    sG   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/command_line/scons.pyt   <module>   s   			#