o
    '¦i  ã                   @  s\   d Z ddlmZ ddlZddlZddlmZ ddlmZm	Z	 ddl
mZ G dd	„ d	e	ƒZdS )
zŒIn-memory filesystem to store ephemeral dependencies.

Warning: Not for external use. May change at any moment. Likely to be made internal.
é    )ÚannotationsN)ÚAbstractFileSystem)Ú
MemoryFileÚMemoryFileSystemé   )ÚBytesIOWrapperc                   @  s4   e Zd ZU dZdZeejjƒZde	d< ddd„Z
dS )ÚModifiedMemoryFileSystemz?In-memory filesystem implementation that uses its own protocol.)ÚDUCKDB_INTERNAL_OBJECTSTOREztyping.Callable[[str], str]Ú_strip_protocolÚobjú#io.IOBase | BytesIOWrapper | objectÚpathÚstrÚreturnÚNonec                 C  sX   t |dƒr
t |dƒsd}t|ƒ‚t|tjƒrt|ƒ}|  |¡}t| || ¡ ƒ| j	|< dS )zAdd a file to the filesystem.ÚreadÚseekz(Can not read from a non file-like objectN)
ÚhasattrÚ	TypeErrorÚ
isinstanceÚioÚ
TextIOBaser   r
   r   r   Ústore)Úselfr   r   Úmsg© r   úO/home/ubuntu/transcripts/venv/lib/python3.10/site-packages/duckdb/filesystem.pyÚadd_file   s   
z!ModifiedMemoryFileSystem.add_fileN)r   r   r   r   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚprotocolÚclassmethodr   r
   Ú__func__Ú__annotations__r   r   r   r   r   r      s
   
 r   )r!   Ú
__future__r   r   ÚtypingÚfsspecr   Úfsspec.implementations.memoryr   r   Úbytes_io_wrapperr   r   r   r   r   r   Ú<module>   s    