B
    ž3Rcë  ã               @   s"   d Z G dd„ deƒZddd„ZdS )z, utility functions to help work with files

c               @   s   e Zd ZdS )ÚNoMatchFoundErrorN)Ú__name__Ú
__module__Ú__qualname__© r   r   ú4lib/python3.7/site-packages/rdkit/utils/fileutils.pyr   
   s   r   é    c             C   s^   |   ¡ }d}x<|sH|rH| |¡}|r,|dks8|s>|dkr>d}q|   ¡ }qW |rR|S t|ƒ‚dS )a°   skip forward in a file until a given string is found

     **Arguments**

       - inFile: a file object (or anything supporting a _readline()_ method)

       - matchStr: the string to search for

       - fullMatch: if nonzero, _matchStr_ must match the entire line

     **Returns**

       the matching line

     **Notes:**

       - if _matchStr_ is not found in the file, a NoMatchFound exception
         will be raised

  r   éÿÿÿÿé   N)ÚreadlineÚfindr   )ZinFileZmatchStrZ	fullMatchZinLineZmatchedÚidxr   r   r   ÚMoveToMatchingLine   s    

r   N)r   )Ú__doc__ÚRuntimeErrorr   r   r   r   r   r   Ú<module>   s   