ó
…™xTc           @   sF   d  d l  m Z d  d l m Z d  d l m Z d d d d „ Z d S(   iÿÿÿÿ(   t   division(   t   crystal(   t   detect_binary_filec   
      C   sæ  |  | g j  d  ƒ d k s! t ‚ | d  k r< t |  ƒ } n  t d | ƒ } d  } d  } xU| D]M} | d  k	 r¤ | j d | ƒ } | d  k	 r¤ | r˜ Pn  d  } q¤ n  | j d d ƒ d j ƒ  } t | ƒ d k r^ | d j ƒ  }	 |	 d k r,t | ƒ d k st ‚ d j	 | d ƒ } | d  k	 r¨Pq¨q«|	 d k r«t | ƒ d k sPt ‚ | d j
 d	 d
 ƒ j d
 ƒ d } | j ƒ  j d ƒ r•| d  } n  | d  k	 r¨Pq¨q«q^ q^ W| | g j  d  ƒ d k  sÐt ‚ t j d | d | ƒ S(   Ni   t   monitor_initialt   blockt   !i    t   CELLt    t   SYMFILEs   \t   /iÿÿÿÿs   .symiüÿÿÿi   t	   unit_cellt   space_group_symbol(   t   countt   Nonet   AssertionErrort   openR   t   is_binary_filet   splitt   lent   uppert   joint   replacet   lowert   endswithR   t   symmetry(
   t	   file_namet   fileR   t   detect_binaryR
   R   t   linet	   is_binaryt   fldst   keyword(    (    sS   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/solve/crystal_symmetry_from_inp.pyt   extract_from   s@    ! #!	N(   t
   __future__R    t   cctbxR   t   libtbx.utilsR   R   R    (    (    (    sS   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/solve/crystal_symmetry_from_inp.pyt   <module>   s   