ef rddlmZmZddlZddlZddlZddlZddlmZm Z m Z m Z m Z m Z GddeZdS))absolute_importdivisionN)LockBase LockFailed NotLocked NotMyLock LockTimeout AlreadyLockedc:eZdZdZd dZd dZdZdZdZd Z dS) MkdirLockFilez"Lock file by creating a directory.TNctj||||tj|j|jd|j|j|_ dS)zs >>> lock = MkdirLockFile('somefile') >>> lock = MkdirLockFile('somefile', threaded=False) .N) r__init__ospathjoin lock_filehostnametnamepid unique_name)selfrthreadedtimeouts v/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/lockfile/mkdirlockfile.pyrzMkdirLockFile.__init__s] $h8887<<59]]]59ZZ59XX)?@@c||n|j}tj}| |dkr||z }|d}ntd|dz } tj|jt |jddS#t$rtj d}|j tj krtj|jrYdS|Ktj|kr4|dkrt!d|jzt#d|jztj|nt'd |jzYnwxYw#) Nrg? Twbrz&Timeout waiting to acquire lock for %sz%s is already lockedzfailed to create %s)rtimemaxrmkdirropenrcloseOSErrorsysexc_infoerrnoEEXISTrexistsr r sleepr)rrend_timewaiterrs racquirezMkdirLockFile.acquires$0''dl9;;  7Q;;  H ?DDq'B,''D  (((,T%t,,22444- M M MlnnQ'9 ,,w~~d&677*ty{{X/E/E"Q;;"-/=.2i/8#9#99 #00F04 1:#;#;;Jt$$$$%%:T^%KLLL%$! M sBAE#'A9E#"E#c6|std|jztj|jst d|jztj|jtj|j dS)Nz%s is not lockedz%s is locked, but not by me) is_lockedrrrr+rr unlinkrmdirrrs rreleasezMkdirLockFile.releaseAs~~ G.:;; ; 011 G9DIEFF F $"###      rcJtj|jSN)rrr+rr5s rr2zMkdirLockFile.is_lockedIsw~~dn---rcr|o#tj|jSr8)r2rrr+rr5s r i_am_lockingzMkdirLockFile.i_am_lockingLs-  1t/00 2rc*tj|jrntj|jD]9}tjtj|j|:tj|jdSdSr8)rrr+rlistdirr3rr4)rnames r break_lockzMkdirLockFile.break_lockPs| 7>>$. ) ) % 4>22 > > "',,t~t<<==== HT^ $ $ $ $ $ % %r)TNr8) __name__ __module__ __qualname____doc__rr0r6r2r:r>rrr r s,, @ @ @ @$$$$L!!!...222%%%%%rr ) __future__rrr!rr'r)rrrr r r r rCrrrFs00000000 H%H%H%H%H%HH%H%H%H%H%r