U
    be                     @   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_stringZ
local_path r
   W/var/www/html/services/stratfitenv/lib/python3.8/site-packages/smart_open/local_file.py	parse_uri   s    r   c                 C   s   t | }t|d |}|S )Nr   )r   ioopen)r	   modeZtransport_paramsZ
parsed_uriZ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   ZURI_EXAMPLESr   r   r   r   r
   r
   r
   r   <module>   s   
