ó
á™xTc           @   s‹   d  d l  m Z d d d d d g Z e e e e e e ƒ ƒ ƒ ƒ Z d „  Z d „  Z e	 d	 k r‡ d  d
 l
 Z
 e d e
 j d ƒ n  d
 S(   iÿÿÿÿ(   t   divisiont   boostt   scitbxt   cctbxt   rstbxt   labelitc         C   sS   d „  } | |  ƒ | | ƒ } } t  | | ƒ } | d k rO t  |  | ƒ } n  | S(   Nc         S   s)   |  j  d ƒ d } t j | t t ƒ ƒ S(   Nt   _i    (   t   splitt   priost   gett   len(   t   st   k(    (    sP   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/command_line/import_all_ext.pyt   prio   s    i    (   t   cmp(   t   at   bR   t   pat   pbt   result(    (    sP   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/command_line/import_all_ext.pyt   cmp_so   s    	c         B   sì  e  |  ƒ d k s t ‚ d d  l } | j ƒ  } d d l m } d d  l } d GHd | j ƒ  | GHHd } | j j | j d d ƒ } g  } x: | j	 | ƒ D]) } | j
 d	 ƒ r� | j | d
  ƒ q� q� W| j e ƒ d GH| j ƒ  }	 |	 j d d ƒ |	 j d ƒ }
 |	 j d ƒ } d | j ƒ  | GHHx‹ | D]ƒ } | j ƒ  } d | d  U| j ƒ  }	 |	 j d ƒ } |	 j d ƒ } d | j ƒ  | | |
 | | | | | f GH| }
 | } q1WHd GH| j ƒ  j d d ƒ d | j ƒ  | GHHd  S(   Ni    iÿÿÿÿ(   t   introspections   After script imports:s     wall clock time: %.2fi   t   LIBTBX_BUILDt   libs   _ext.soiýÿÿÿs   Before importing extensios:t   prefixs     s   VmSize:s   VmRSS:s	   import %ss   %.2f %3.0f %3.0f %ss   After importing all extensios:i   (   R
   t   AssertionErrort   timet   libtbxR   t   ost   patht   joint   environt   listdirt   endswitht   appendt   sortR   t   virtual_memory_infot   showt	   get_bytes(   t   argsR   t   t_startR   R   t   mbR   t   ext_sot   nodet   vmit   prev_vmst   prev_rsst   sot   t0t   vmst   rss(    (    sP   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/command_line/import_all_ext.pyt   run   sN    	
	,
t   __main__NR'   i   (   t
   __future__R    R   t   dictt   zipt   rangeR
   R   R3   t   __name__t   syst   argv(    (    (    sP   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/command_line/import_all_ext.pyt   <module>   s   !	
	)