o
    \~#g                     @  sz   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
 d
eZd
gZdS )    )annotationsN)suppress)EACCESEEXIST)Path   )BaseFileLock)ensure_directory_existsraise_on_not_writable_filec                   @  s$   e Zd ZdZd	ddZd	ddZdS )
SoftFileLockz.Simply watches the existence of the lock file.returnNonec              
   C  s   t | j t| j tjtjB tjB tjB }zt| j|| j	j
}W n* tyL } z|jtks:|jtkr9tjdksA W Y d }~d S W Y d }~d S d }~ww || j	_d S )Nwin32)r
   	lock_filer	   osO_WRONLYO_CREATO_EXCLO_TRUNCopen_contextmodeOSErrorerrnor   r   sysplatformlock_file_fd)selfflagsfile_handler	exception r!   s/var/www/static.ux5.de/https/Moving-Object-Detection-with-OpenCV/env/lib/python3.10/site-packages/filelock/_soft.py_acquire   s*   


zSoftFileLock._acquirec                 C  sb   | j jd usJ t| j j d | j _tt t| j  W d    d S 1 s*w   Y  d S )N)	r   r   r   closer   r   r   r   unlink)r   r!   r!   r"   _release%   s   
"zSoftFileLock._releaseN)r   r   )__name__
__module____qualname____doc__r#   r&   r!   r!   r!   r"   r      s    
r   )
__future__r   r   r   
contextlibr   r   r   r   pathlibr   _apir   _utilr	   r
   r   __all__r!   r!   r!   r"   <module>   s    !