ó
áxTc           @   s`   d  d l  m Z d  d l Z d  d l Z d  d l Z d   Z d   Z e d k r\ e   n  d S(   i˙˙˙˙(   t   divisionNc          C   sn  t  t j  d k  r t   n  t j j d  }  t j j	 |  d  } t j d } g  } g  } xB t j d D]3 } d | k r | j
 d |  qm | j
 |  qm Wd j	 |  } t j j |  rt j j |  r| d d	 k rö | d	 7} n  t j j	 | |  } n  t j j |  s*t   n  d d
 d d | g | d d t j | f g } t j d |  d  S(   Ni   t   libtbxt   dtracei   t   =s   -D%st    iţ˙˙˙s   .ds   -Zs   -Cs   -ss   -cs   %s %s(   t   lent   syst   argvt   helpR   t   envt   find_in_repositoriest   ost   patht   joint   appendt   isfilet   dirnamet
   executablet   execvp(   t   libtbx_patht   dtrace_directoryt   dtrace_scriptt   paramst   python_script_and_its_argumentst   optt   args(    (    sH   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/command_line/dtrace.pyt   run   s,     
  
c           C   s/   d Gd GHHd GHd GHd GHd GHt  j d  d  S(   Ns6   usage: libtbx.dtrace dtrace_script [ param=value ...] s   python_script [args ...]s>          dtrace_script can be either the path of a dtrace scripts;          or if there is no file at that path, a dtrace scriptsA          in libtbx/dtrace. In the latter case, the extension .d cans#          omitted on the command line.i   (   R   t   exit(    (    (    sH   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/command_line/dtrace.pyR   "   s    t   __main__(	   t
   __future__R    R   R   t   libtbx.load_envR   R   R   t   __name__(    (    (    sH   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/command_line/dtrace.pyt   <module>   s   		
