o
    
 ¢iì  ã                   @   s>   d Z ddlZddlZdZdZejZdd„ Zdd„ Zd	d
„ Z	dS )z0Implements the transport for the file:// schema.é    NÚfile)z./local/path/filez~/local/path/filezlocal/path/filez./local/path/file.gzzfile:///home/user/filezfile:///home/user/file.bz2c                 C   s   t | ƒ}tt|dS )N)ÚschemeÚuri_path)Úextract_local_pathÚdictÚSCHEME©Úuri_as_stringÚ
local_path© r   úI/home/ubuntu/.local/lib/python3.10/site-packages/smart_open/local_file.pyÚ	parse_uri   s   r   c                 C   s   t | ƒ}t |d |¡}|S )Nr   )r   ÚioÚopen)r	   ÚmodeÚtransport_paramsÚ
parsed_uriÚfobjr   r   r   Úopen_uri    s   r   c                 C   s*   |   d¡r|  ddd¡}n| }tj |¡S )Nzfile://Ú é   )Ú
startswithÚreplaceÚosÚpathÚ
expanduserr   r   r   r   r   &   s   
r   )
Ú__doc__r   Úos.pathr   r   ÚURI_EXAMPLESr   r   r   r   r   r   r   r   Ú<module>   s   
