
    1;ji                        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
 ddlmZ ddlmZmZ  G d	 d
e          Zd
gZdS )    )annotationsN)suppress)EACCESEEXIST)Path   )BaseFileLock)ensure_directory_existsraise_on_not_writable_filec                  "    e Zd ZdZddZddZdS )SoftFileLockz.Simply watches the existence of the lock file.returnNonec                   t          | j                   t          | j                   t          j        t          j        z  t          j        z  t          j        z  }t          t          dd           }|||z  }	 t          j	        | j        || j
        j                  }|| j
        _        d S # t          $ rB}|j        t          k    s!|j        t           k    rt"          j        dk    s Y d }~d S Y d }~d S d }~ww xY w)N
O_NOFOLLOWwin32)r   	lock_filer
   osO_WRONLYO_CREATO_EXCLO_TRUNCgetattropen_contextmodelock_file_fdOSErrorerrnor   r   sysplatform)selfflags
o_nofollowfile_handler	exceptions        H/root/voice-cloning/.venv/lib/python3.11/site-packages/filelock/_soft.py_acquirezSoftFileLock._acquire   s   "4>222///Kji j 	 Rt44
!ZE		674>5$-:LMML *6DM&&&  	 	 	6))Ov--#,'2I2I *)))))2I2I2I2I2I2I	s   :%B- -
C971C44C9c                   | j         j        J t          j        | j         j                   d | j         _        t	          t
                    5  t          | j                                                   d d d            d S # 1 swxY w Y   d S )N)	r   r   r   closer   r   r   r   unlink)r"   s    r'   _releasezSoftFileLock._release'   s    })555
+,,,%)"g 	* 	*  '')))	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	*s   'BBBN)r   r   )__name__
__module____qualname____doc__r(   r,        r'   r   r      sB        886 6 6 6.* * * * * *r2   r   )
__future__r   r   r    
contextlibr   r   r   r   pathlibr   _apir	   _utilr
   r   r   __all__r1   r2   r'   <module>r9      s    " " " " " " 				 



                                   F F F F F F F F* * * * *< * * *F r2   