o
    RÅ€gÑ  ã                   @   s<   d Z ddlmZ ddlmZ ddlmZ G dd„ deƒZdS )z)Custom indexing for Bio.SearchIO objects.é    )ÚStringIO)Ú_IndexedSeqFileProxy)Ú_open_for_random_accessc                   @   s(   e Zd ZdZdd„ Zdd„ Zdd„ ZdS )	ÚSearchIndexerzšBase class for file format specific random access.

    Subclasses for each file format should define '_parser' and optionally
    'get_raw' methods.
    c                 K   s   t |ƒ| _|| _dS )zInitialize the class.N)r   Ú_handleÚ_kwargs)ÚselfÚfilenameÚkwargs© r   úG/var/www/html/myenv/lib/python3.10/site-packages/Bio/SearchIO/_index.pyÚ__init__   s   

zSearchIndexer.__init__c                 C   s   t t| j|fi | j¤ŽƒƒS )z9Pass handle and arguments to the next iterable (PRIVATE).)ÚnextÚiterÚ_parserr   )r   Úhandler   r   r   Ú_parse   s   zSearchIndexer._parsec                 C   s   |   t|  |¡ ¡ ƒ¡S )z/Get offset and convert it from bytes to string.)r   r   Úget_rawÚdecode)r   Úoffsetr   r   r   Úget!   s   zSearchIndexer.getN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r      s
    r   N)r   Úior   ÚBio.Filer   r   r   r   r   r   r   Ú<module>   s
   