Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
B

•Bցёã@spdZddlZddlZddlZddlZyddlZWnek
rHdZYnXyddlZWnek
rndZYnXyddlZWnek
r”dZYnXye	Wne
k
r¶eZ	YnXddddddgZd	Z
dad
d„ZGdd„de	ƒZGd
d„deƒZGdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZdZerHeZn$erTeZneZedk	rle d¡dS)zD
A platform independent file lock that supports the with-statement.
éNÚTimeoutÚBaseFileLockÚWindowsFileLockÚUnixFileLockÚSoftFileLockÚFileLockz3.0.12cCstpt t¡atS)z0Returns the logger instance used in this module.)Ú_loggerÚloggingÚ	getLoggerÚ__name__©rrúŒ/build/wlanpi-profiler-ypsphn/wlanpi-profiler-1.0.6/debian/wlanpi-profiler/opt/venvs/wlanpi-profiler/lib/python3.7/site-packages/filelock.pyÚloggerLsrc@s eZdZdZdd„Zdd„ZdS)rzN
    Raised when the lock could not be acquired in *timeout*
    seconds.
    cCs
||_dS)z	
        N)Ú	lock_file)Úselfrrrr
Ú__init__[szTimeout.__init__cCsd |j¡}|S)Nz)The file lock '{}' could not be acquired.)Úformatr)rÚtemprrr
Ú__str__bszTimeout.__str__N)rÚ
__module__Ú__qualname__Ú__doc__rrrrrr
rUsc@s$eZdZdd„Zdd„Zdd„ZdS)Ú_Acquire_ReturnProxycCs
||_dS)N)Úlock)rrrrr
rusz_Acquire_ReturnProxy.__init__cCs|jS)N)r)rrrr
Ú	__enter__ysz_Acquire_ReturnProxy.__enter__cCs|j ¡dS)N)rÚrelease)rÚexc_typeÚ	exc_valueÚ	tracebackrrr
Ú__exit__|s
z_Acquire_ReturnProxy.__exit__N)rrrrrrrrrr
rssrc@sˆeZdZdZddd„Zedd„ƒZedd„ƒZejd	d„ƒZd
d„Z	dd
„Z
edd„ƒZddd„Zddd„Z
dd„Zdd„Zdd„ZdS) rz3
    Implements the base class of a file lock.
    éÿÿÿÿcCs&||_d|_||_t ¡|_d|_dS)z	
        Nr)Ú
_lock_fileÚ
_lock_file_fdÚtimeoutÚ	threadingÚLockÚ_thread_lockÚ
_lock_counter)rrr#rrr
r†s
zBaseFileLock.__init__cCs|jS)z,
        The path to the lock file.
        )r!)rrrr
ržszBaseFileLock.lock_filecCs|jS)a~
        You can set a default timeout for the filelock. 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.

        .. versionadded:: 2.0.0
        )Ú_timeout)rrrr
r#¥szBaseFileLock.timeoutcCst|ƒ|_dS)z	
        N)Úfloatr()rÚvaluerrr
r#µs
cCs
tƒ‚dS)z˜
        Platform dependent. If the file lock could be
        acquired, self._lock_file_fd holds the file descriptor
        of the lock file.
        N)ÚNotImplementedError)rrrr
Ú_acquire¿szBaseFileLock._acquirecCs
tƒ‚dS)zH
        Releases the lock and sets self._lock_file_fd to None.
        N)r+)rrrr
Ú_releaseÇszBaseFileLock._releasecCs
|jdk	S)zž
        True, if the object holds the file lock.

        .. versionchanged:: 2.0.0

            This was previously a method and is now a property.
        N)r")rrrr
Ú	is_lockedÐs	zBaseFileLock.is_lockedN皙™™™™©?cCs&|dkr|j}|j|jd7_WdQRXt|ƒ}|j}t ¡}y¤xž|j$|jsntƒ d||¡| 	¡WdQRX|jr’tƒ 
d||¡PqH|dkrÆt ¡||krÆtƒ d||¡t|jƒ‚qHtƒ d|||¡t |¡qHWWn2|jt
d|jdƒ|_WdQRX‚YnXt|dS)	aY
        Acquires the file lock or fails with a :exc:`Timeout` error.

        .. 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()

        :arg float timeout:
            The maximum time waited for the file lock.
            If ``timeout < 0``, there is no timeout and this method will
            block until the lock could be acquired.
            If ``timeout`` is None, the default :attr:`~timeout` is used.

        :arg float poll_intervall:
            We check once in *poll_intervall* seconds if we can acquire the
            file lock.

        :raises Timeout:
            if the lock could not be acquired in *timeout* seconds.

        .. 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.
        Néz#Attempting to acquire lock %s on %szLock %s acquired on %srz"Timeout on acquiring lock %s on %sz2Lock %s not acquired on %s, waiting %s seconds ...)r)r#r&r'Úidr!Útimer.rÚdebugr,ÚinforÚsleepÚmaxr)rr#Zpoll_intervallÚlock_idÚ
lock_filenameÚ
start_timerrr
ÚacquireÛs8$
zBaseFileLock.acquireFc	Cst|jd|jrf|jd8_|jdks*|rft|ƒ}|j}tƒ d||¡| ¡d|_tƒ d||¡WdQRXdS)aV
        Releases the file lock.

        Please note, that the lock is only completly released, if the lock
        counter is 0.

        Also note, that the lock file itself is not automatically deleted.

        :arg bool force:
            If true, the lock counter is ignored and the lock is released in
            every case.
        r0rz#Attempting to release lock %s on %szLock %s released on %sN)	r&r.r'r1r!rr3r-r4)rÚforcer7r8rrr
r%s
zBaseFileLock.releasecCs| ¡|S)N)r:)rrrr
rBszBaseFileLock.__enter__cCs| ¡dS)N)r)rrrrrrr
rFszBaseFileLock.__exit__cCs|jdddS)NT)r;)r)rrrr
Ú__del__JszBaseFileLock.__del__)r )Nr/)F)rrrrrÚpropertyrr#Úsetterr,r-r.r:rrrr<rrrr
rs

	
J
c@s eZdZdZdd„Zdd„ZdS)rze
    Uses the :func:`msvcrt.locking` function to hard lock the lock file on
    windows systems.
    c	Cs|tjtjBtjB}yt |j|¡}Wntk
r8Yn@Xyt |tj	d¡Wn"t
tfk
rpt |¡YnX||_dS)Nr0)
ÚosÚO_RDWRÚO_CREATÚO_TRUNCÚopenr!ÚOSErrorÚmsvcrtÚlockingZLK_NBLCKÚIOErrorÚcloser")rÚ	open_modeÚfdrrr
r,XszWindowsFileLock._acquirecCsP|j}d|_t |tjd¡t |¡yt |j¡Wntk
rJYnXdS)Nr0)	r"rErFZLK_UNLCKr?rHÚremover!rD)rrJrrr
r-hs
zWindowsFileLock._releaseN)rrrrr,r-rrrr
rRsc@s eZdZdZdd„Zdd„ZdS)rzR
    Uses the :func:`fcntl.flock` to hard lock the lock file on unix systems.
    c	CsftjtjBtjB}t |j|¡}yt |tjtj	B¡Wn"t
tfk
rZt |¡YnX||_
dS)N)r?r@rArBrCr!ÚfcntlÚflockZLOCK_EXZLOCK_NBrGrDrHr")rrIrJrrr
r,~szUnixFileLock._acquirecCs(|j}d|_t |tj¡t |¡dS)N)r"rLrMZLOCK_UNr?rH)rrJrrr
r-Šs

zUnixFileLock._releaseN)rrrrr,r-rrrr
rysc@s eZdZdZdd„Zdd„ZdS)rz8
    Simply watches the existence of the lock file.
    c	CsNtjtjBtjBtjB}yt |j|¡}Wnttfk
rBYnX||_	dS)N)
r?ÚO_WRONLYrAÚO_EXCLrBrCr!rGrDr")rrIrJrrr
r,szSoftFileLock._acquirecCs<t |j¡d|_yt |j¡Wntk
r6YnXdS)N)r?rHr"rKr!rD)rrrr
r-§szSoftFileLock._releaseN)rrrrr,r-rrrr
r˜s
z only soft file lock is available)rr	r?r$r2ÚwarningsÚImportErrorrErLÚTimeoutErrorÚ	NameErrorrDÚ__all__Ú__version__rrrÚobjectrrrrrrÚwarnrrrr
Ú<module>sX



	R'!