U
    ®[Öe3  ã                   @   sH   d Z ddlmZmZ i Zdag Zg Zdd„ Zdd„ Z	dd	„ Z
d
d„ ZdS )z»
    pyexcel_io.manager
    ~~~~~~~~~~~~~~~~~~~

    Control file streams

    :copyright: (c) 2014-2022 by Onni Software Ltd.
    :license: New BSD License, see LICENSE for more details
é    )ÚBytesIOÚStringIO© c                 C   s*   |dkrt  | ¡ n|dkr&t | ¡ dS )z>
    keep track of stream type for different file formats
    ÚtextÚbinaryN)ÚTEXT_STREAM_TYPESÚappendÚBINARY_STREAM_TYPES)Ú	file_typeÚstream_typer   r   úT/var/www/html/services/stratfitenv/lib/python3.8/site-packages/pyexcel_io/manager.pyÚregister_stream_type   s    r   c                 C   s4   d}| r|   ¡ }|tkrtƒ S |tkr,tƒ S dS dS )ú£A utility function to help you generate a correct io stream

    :param file_type: a supported file type
    :returns: a appropriate io stream, None otherwise
    N)Úlowerr   r   r	   r   ©r
   Z__file_typer   r   r   Úget_io   s    r   c                 C   s0   d}| r|   ¡ }|tkrdS |tkr(dS dS dS )r   NÚstringÚbytes)r   r   r	   r   r   r   r   Úget_io_type0   s    r   c                 C   s,   t | f7 a |}|dk	r|t| < t| |ƒ dS )z<
    keep track of file format supports by this library
    N)Ú
FILE_TYPESÚ
MIME_TYPESr   )r
   r   Z	mime_typer   r   r   Úregister_a_file_typeD   s
    
r   N)Ú__doc__Zpyexcel_io._compactr   r   r   r   r   r	   r   r   r   r   r   r   r   r   Ú<module>   s   	
