§ {<ˆjT.ãóˆ—ddlmZddlZddlZddlZddlZddlZddlmZm Z ddl m Z ddl m Z ddlmZmZmZddlmZdd lmZer"ddlZdd lmZejd krdd lmZndd lmZejd ¦«ZGd„d¦«Ze Gd„d¦«¦«ZGd„dee ¦«Z Gd„deej!¦«Z"ddgZ#dS)é)Ú annotationsN)ÚABCÚabstractmethod)Ú dataclass)Úlocal)Ú TYPE_CHECKINGÚAnyÚClassVar)ÚWeakValueDictionaryé)ÚTimeout)Ú TracebackType)éé )ÚSelfÚfilelockcó*—eZdZdZdd„Zdd„Zdd„ZdS)ÚAcquireReturnProxyzDA context aware object that will release the lock file when exiting.ÚlockÚ BaseFileLockÚreturnÚNonecó—||_dS©N©r)Úselfrs ú_/builddir/build/BUILD/cloudlinux-venv-1.0.12/venv/lib/python3.11/site-packages/filelock/_api.pyÚ__init__zAcquireReturnProxy.__init__#s €ØˆŒ ˆ ˆ ócó—|jSrr©rs rÚ __enter__zAcquireReturnProxy.__enter__&s €ØŒyÐrÚexc_typeútype[BaseException] | NoneÚ exc_valueúBaseException | NoneÚ tracebackúTracebackType | Nonecó8—|j ¦«dSr)rÚrelease©rr#r%r's rÚ__exit__zAcquireReturnProxy.__exit__)s€ð Œ ×ÒÑÔÐÐÐrN)rrrr)rr©r#r$r%r&r'r(rr)Ú__name__Ú __module__Ú __qualname__Ú__doc__rr"r,©rrrr sV€€€€€ØNÐNððððððððððððððrrcóN—eZdZUdZded<ded<ded<dZd ed <d Zded <dS) ÚFileLockContextzBA dataclass which holds the context for a ``BaseFileLock`` object.ÚstrÚ lock_fileÚfloatÚtimeoutÚintÚmodeNz int | NoneÚ lock_file_fdrÚ lock_counter)r.r/r0r1Ú__annotations__r;r<r2rrr4r42s_€€€€€€àLÐLð €N€N�Nð€N€N�Nð€I€I�Ið $€LÐ#Ð#Ð#Ñ#ð€LÐÐÐÑÐÐrr4có—eZdZdZdS)ÚThreadLocalFileContextz8A thread local version of the ``FileLockContext`` class.N)r.r/r0r1r2rrr?r?Is€€€€€ØBÐBÐBÐBrr?cór‡—eZdZUdZe¦«Zded< d9ddœd:ˆfd„Z d9ddœd;d„Zdd„¦«Z e jd?d „¦«Z ed@d!„¦«Zed@d"„¦«Ze d×%Ò%¥c¨)¡n¤nÑ5Ô5ˆØð 6Ý‘w”w—’ sÑ+Ô+ˆHØ-5ˆCŒN�3˜y™>œ>Ñ *àˆrrcóˆ—||_||_tj|¦«||dœ}|rtnt di|¤Ž|_dS)a® Create a new lock object. :param lock_file: path to the file :param timeout: default timeout when acquiring the lock, in seconds. It will be used as fallback value in the acquire method, if no timeout value (``None``) is given. If you want to disable the timeout, set it to a negative value. A timeout of 0 means, that there is exactly one attempt to acquire the file lock. :param mode: file permissions for the lockfile :param thread_local: Whether this object's internal context should be thread local or not. If this is set to ``False`` then the lock will be reentrant across threads. :param is_singleton: If this is set to ``True`` then only one instance of this class will be created per lock file. This is useful if you want to use the lock object for reentrant locking without needing to pass the same object around. )r6r8r:Nr2)Ú_is_thread_localÚ _is_singletonÚosÚfspathr?r4Ú_context)rr6r8r:rFrDrHs rrzBaseFileLock.__init__gs`€ð.!-ˆÔØ)ˆÔõ œ 9Ñ-Ô-ØØð" ð" ˆð +fÀLÐ*eÕ*@Ð*@ÕVeÐ)pÐ)pÐioÐ)pÐ)pˆŒ ˆ ˆ rcó—|jS)z>:return: a flag indicating if this lock is thread local or not)rRr!s rÚis_thread_localzBaseFileLock.is_thread_localŠs €àÔ$Ð$rcó—|jS)z;:return: a flag indicating if this lock is singleton or not)rSr!s rrDzBaseFileLock.is_singletonŽs €ðÔ!Ð!rr5có—|jjS)z:return: path to the lock file)rVr6r!s rr6zBaseFileLock.lock_file“s€ðŒ}Ô&Ð&rcó—|jjS)za :return: the default timeout value, in seconds .. versionadded:: 2.0.0 )rVr8r!s rr8zBaseFileLock.timeout˜s€ðŒ}Ô$Ð$rÚvalueú float | strcó8—t|¦«|j_dS)zd Change the default timeout value. :param value: the new value, in seconds N)r7rVr8)rr\s rr8zBaseFileLock.timeout¡s€õ!& e¡ ¤ ˆŒ ÔÐÐrcó—t‚)zjIf the file lock could be acquired, self._context.lock_file_fd holds the file descriptor of the lock file.©ÚNotImplementedErrorr!s rÚ_acquirezBaseFileLock._acquireªó €õ"Ð!rcó—t‚)z>Releases the lock and sets self._context.lock_file_fd to None.r`r!s rÚ_releasezBaseFileLock._release¯rcrcó—|jjduS)zÄ :return: A boolean indicating if the lock file is holding the lock currently. .. versionchanged:: 2.0.0 This was previously a method and is now a property. N)rVr;r!s rÚ is_lockedzBaseFileLock.is_locked´s€ðŒ}Ô)°Ð5Ð5rcó—|jjS)zP:return: The number of times this lock has been acquired (but not yet released).)rVr<r!s rr<zBaseFileLock.lock_counterÀs€ðŒ}Ô)Ð)rNçš™™™™™©?)Úpoll_intervallÚblockingú float | NoneÚ poll_intervalrjrkrcóŒ—|€ |jj}|� d}tj|td¬¦«|}|jxjdz c_t |¦«}|j}tj ¦«} |j s0t  d||¦«|  ¦«|j rt  d||¦«n³|d ur+t  d ||¦«t|¦«‚d |cxkrtj ¦«|z kr.nn+t  d ||¦«t|¦«‚d }t  ||||¦«tj|¦«�Œn6#t $r)t#d |jjdz ¦«|j_‚wxYwt%|¬¦«S)a_ Try to acquire the file lock. :param timeout: maximum wait time for acquiring the lock, ``None`` means use the default :attr:`~timeout` is and if ``timeout < 0``, there is no timeout and this method will block until the lock could be acquired :param poll_interval: interval of trying to acquire the lock file :param poll_intervall: deprecated, kept for backwards compatibility, use ``poll_interval`` instead :param blocking: defaults to True. If False, function will return immediately if it cannot obtain a lock on the first attempt. Otherwise, this method will block until the timeout expires or the lock is acquired. :raises Timeout: if fails to acquire lock within the timeout period :return: a context object that will unlock the file when the context is exited .. code-block:: python # You can use this method in the context manager (recommended) with lock.acquire(): pass # Or use an equivalent try-finally construct: lock.acquire() try: pass finally: lock.release() .. versionchanged:: 2.0.0 This method returns now a *proxy* object instead of *self*, so that it can be used in a with statement without side effects. Nz+use poll_interval instead of poll_intervallé)Ú stacklevelr Tz#Attempting to acquire lock %s on %szLock %s acquired on %sFz+Failed to immediately acquire lock %s on %srz"Timeout on acquiring lock %s on %sz2Lock %s not acquired on %s, waiting %s seconds ...r)rVr8ÚwarningsÚwarnÚDeprecationWarningr<Úidr6ÚtimeÚ perf_counterrgÚ_LOGGERÚdebugrbr ÚsleepÚ BaseExceptionÚmaxr) rr8rmrjrkÚmsgÚlock_idÚ lock_filenameÚ start_times rÚacquirezBaseFileLock.acquireÅsá€ðP ˆ?Ø”mÔ+ˆGà Ð %Ø?ˆCÝ ŒM˜#Õ1¸aÐ @Ñ @Ô @Ð @Ø*ˆMð Œ Ð"Ô" aÑ'Ð"Ô"å�T‘(”(ˆØœˆ ÝÔ&Ñ(Ô(ˆ ð ð *Ø”~ð$Ý—M’MÐ"GÈÐR_Ñ`Ô`Ð`Ø—M’M‘O”O�OØ”>ðÝ—M’MÐ":¸GÀ]ÑSÔSÐSØØ˜uÐ$Ð$Ý—M’MÐ"OÐQXÐZgÑhÔhÐhÝ! -Ñ0Ô0Ð0ؘÐBÐBÒBÐB¥$Ô"3Ñ"5Ô"5¸ Ñ"BÒBÐBÐBÐBÐBÝ—M’MÐ"FÈÐQ^Ñ_Ô_Ð_Ý! -Ñ0Ô0Ð0ØJ�Ý— ’ ˜c 7¨M¸=ÑIÔIÐIÝ” ˜=Ñ)Ô)Ð)ñ *ð øõð ð ð Ý),¨Q°´ Ô0JÈQÑ0NÑ)OÔ)OˆDŒMÔ &Ø ð øøøõ" tÐ,Ñ,Ô,Ð,s Á0DFÆ3F3ÚforcecóF—|jr—|jxjdzc_|jjdks|rrt|¦«|j}}t  d||¦«| ¦«d|j_t  d||¦«dSdSdS)a* Releases the file lock. Please note, that the lock is only completely released, if the lock counter is 0. Also note, that the lock file itself is not automatically deleted. :param force: If true, the lock counter is ignored and the lock is released in every case/ r rz#Attempting to release lock %s on %szLock %s released on %sN)rgrVr<rtr6rwrxre)rr�r}r~s rr*zBaseFileLock.releasesª€ð Œ>ð PØ ŒMÐ &Ô &¨!Ñ +Ð &Ô &àŒ}Ô)¨QÒ.Ð.°%Ð.Ý)+¨D©¬°4´>˜�å— ’ ÐCÀWÈmÑ\Ô\Ð\Ø— ’ ‘”�Ø-.�” Ô*Ý— ’ Ð6¸ÀÑOÔOÐOÐOÐOð Pð Pð/Ð.rcó.—| ¦«|S)zE Acquire the lock. :return: the lock object )r€r!s rr"zBaseFileLock.__enter__#s€ð � Š ‰ŒˆØˆ rr#r$r%r&r'r(có.—| ¦«dS)zÎ Release the lock. :param exc_type: the exception type if raised :param exc_value: the exception value if raised :param traceback: the exception traceback if raised N©r*r+s rr,zBaseFileLock.__exit__,s€ð � Š ‰Œˆˆˆrcó2—| d¬¦«dS)z'Called when the lock object is deleted.T)r�Nr…r!s rÚ__del__zBaseFileLock.__del__;s€à � Š ˜4ˆ Ñ Ô Ð Ð Ð r)rBrCT)r6rEr8r7r:r9rFrGrDrGrHrIrr) r6rEr8r7r:r9rFrGrDrGrr)rrG)rr5)rr7)r\r]rr)rr)rr9)Nri) r8rlrmr7rjrlrkrGrr)F)r�rGrr)rrr-)r.r/r0r1r rAr=rLrrXÚpropertyrDr6r8Úsetterrrbrergr<r€r*r"r,r‡Ú __classcell__)rPs@rrrMsdø€€€€€€Ø5Ð5àCVÐCVÑCXÔCX€JÐXÐXÐXÑXð ØØ!ð ð#ððððððððð0ØØ!ð !qð#ð!qð!qð!qð!qð!qð!qðF%ð%ð%ð%ðð"ð"ð"ñ„Xð"ðð'ð'ð'ñ„Xð'ðð%ð%ð%ñ„Xð%ð „^ð-ð-ð-ñ„^ð-ðð"ð"ð"ñ„^ð"ðð"ð"ð"ñ„^ð"ðð 6ð 6ð 6ñ„Xð 6ðð*ð*ð*ñ„Xð*ð !%Ø#ðJ-ð (,Øð J-ðJ-ðJ-ðJ-ðJ-ðJ-ðXPðPðPðPðPð$ðððð ð ð ð ð!ð!ð!ð!ð!ð!ð!ð!rr)$Ú __future__rÚ contextlibÚloggingrTrurqÚabcrrÚ dataclassesrÚ threadingrÚtypingrr r Úweakrefr Ú_errorr ÚsysÚtypesrÚ version_inforÚtyping_extensionsÚ getLoggerrwrr4r?ÚContextDecoratorrÚ__all__r2rrúr›s ðØ"Ð"Ð"Ð"Ð"Ð"àÐÐÐØ€€€Ø € € € Ø € € € Ø€€€Ø#Ð#Ð#Ð#Ð#Ð#Ð#Ð#Ø!Ð!Ð!Ð!Ð!Ð!ØÐÐÐÐÐØ/Ð/Ð/Ð/Ð/Ð/Ð/Ð/Ð/Ð/Ø'Ð'Ð'Ð'Ð'Ð'àÐÐÐÐÐàð+Ø€J€J€JØ#Ð#Ð#Ð#Ð#Ð#à Ô˜7Ò"Ð"ØÐÐÐÐÐÐà*Ð*Ð*Ð*Ð*Ð*ð ˆ'Ô ˜JÑ 'Ô '€ð ððððñôðð$ ðððððñôñ „ðð,CðCðCðCðC˜_¨eñCôCðCðp!ðp!ðp!ðp!ðp!�3˜ Ô3ñp!ôp!ðp!ðhØð €€€r