ó
â™xTc           @   s|   d  d l  m Z d  d l Z d  d l Z d  d l Z d  d l m Z d  d l Z d „  Z d „  Z	 e
 d k rx e ƒ  n  d S(   iÿÿÿÿ(   t   divisionN(   t   xmlrpc_utilsc          C   sÔ   t  j j d d d t j j ƒ }  d |  } t j ƒ  } t j	 d | d d d d  d	 t d
 | ƒ } | j ƒ  t j d ƒ t | ƒ | j ƒ  } | j ƒ  d | k sª t ‚ | j ƒ  t j d ƒ t | ƒ d GHd  S(   Nt   relative_paths   libtbx/xmlrpc_server_example.pyt   tests   libtbx.python %st   commandt
   program_idt   TESTt   timeoutt   cache_requestst   logi   sG   XML-RPC server started on port %d
hello, world!
hello, world!
quitting
t   OK(   t   libtbxt   envt   find_in_repositoriest   ost   patht   isfilet	   cStringIOt   StringIOR   t   external_program_servert   Nonet   Truet	   echo_testt   timet   sleept   run_server_testst   get_portt   getvaluet   AssertionErrort   restart(   t
   ext_modulet   full_cmdR	   t   servert   port(    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/tst_xmlrpc_utils.pyt   exercise   s(    
	

	

c         C   sn   |  j  ƒ  t k s t ‚ |  j ƒ  t k s0 t ‚ |  j ƒ  |  j ƒ  t k sR t ‚ |  j  ƒ  d  k sj t ‚ d  S(   N(   R   R   R   t   is_alivet   quitt   FalseR   (   R    (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/tst_xmlrpc_utils.pyR   !   s
    
t   __main__(   t
   __future__R    R   R   t   libtbx.load_envR   R   R   R"   R   t   __name__(    (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/tst_xmlrpc_utils.pyt   <module>   s   		