L iddlmZddlZddlZddlmZddlmZmZddl m Z ddl m Z ddl mZmZGd d e Zd gZy) ) annotationsN)suppress)EACCESEEXIST)Path) BaseFileLock)ensure_directory_existsraise_on_not_writable_filec eZdZdZddZddZy) SoftFileLockz.Simply watches the existence of the lock file.ct|jt|jtjtj ztj ztjz} tj|j||jj}||j_ y#t$rI}|jtk(s,|jtk(rt j"dk(sYd}~yYd}~yd}~wwxYw)Nwin32)r lock_filer osO_WRONLYO_CREATO_EXCLO_TRUNCopen_contextmode lock_file_fdOSErrorerrnorrsysplatform)selfflags file_handler exceptions T/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/filelock/_soft.py_acquirezSoftFileLock._acquires"4>>2/ KKjj ii jj   6774>>5$--:L:LML*6DMM & 6)OOv-#,,'2I3J* s/5B66 D?:DDc6|jjJtj|jjd|j_t t 5t |jjdddy#1swYyxYw)N) rrrcloserrrrunlink)rs r"_releasezSoftFileLock._release%sl}}))555 ++,%) " g  *  ' ' ) * * *s "$BBN)returnNone)__name__ __module__ __qualname____doc__r#r'r"r r s86**r/r ) __future__rrr contextlibrrrrpathlibr_apir _utilr r r __all__r.r/r"r6s6"  F*<*B r/