o �J�h��@szddlmZddlZddlZddlmZddlmZmZddl m Z ddl m Z ddl mZmZGd d �d e �Zd gZdS) �)� annotationsN)�suppress)�EACCES�EEXIST)�Path�)� BaseFileLock)�ensure_directory_exists�raise_on_not_writable_filec@s$eZdZdZd dd�Zd dd�ZdS) � SoftFileLockz.Simply watches the existence of the lock file.�return�Nonec Cs�t|j�t|j�tjtjBtjBtjB}z t�|j||j j �}Wn*t yL}z|j t ks:|j tkr9tjdksA�WYd}~dSWYd}~dSd}~ww||j _dS)N�win32)r � lock_filer �os�O_WRONLY�O_CREAT�O_EXCL�O_TRUNC�open�_context�mode�OSError�errnorr�sys�platform� lock_file_fd)�self�flags� file_handler� exception�r!�LC:\pinokio\api\whisper-webui.git\app\env\lib\site-packages\filelock\_soft.py�_acquires*  ���� ��� zSoftFileLock._acquirecCsb|jjdusJ�t�|jj�d|j_tt��t|j���Wd�dS1s*wYdS)N) rrr�closerrrr�unlink)rr!r!r"�_release%s  "�zSoftFileLock._releaseN)r r )�__name__� __module__� __qualname__�__doc__r#r&r!r!r!r"r s r )� __future__rrr� contextlibrrrr�pathlibr�_apirZ_utilr r r �__all__r!r!r!r"�<module>s    !�
Memory