-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/bzrlib/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/bzrlib/counted_lock.pyc

ó
î:ïNc@@s@dZddlmZddlmZdefd„ƒYZdS(sCounted lock classi(tabsolute_import(terrorstCountedLockcB@sYeZdZd„Zd„Zd„Zd„Zd„Zd„Zd	d„Z
d„ZRS(
sýDecorator around a lock that makes it reentrant.

    This can be used with any object that provides a basic Lock interface,
    including LockDirs and OS file locks.

    :ivar _token: While a write lock is held, this is the token 
        for it.
    cC@s||_d|_d|_dS(Ni(t
_real_locktNonet
_lock_modet_lock_count(tselft	real_lock((s7/usr/lib/python2.7/dist-packages/bzrlib/counted_lock.pyt__init__$s		cC@sd|jj|jfS(Ns%s(%r)(t	__class__t__name__R(R((s7/usr/lib/python2.7/dist-packages/bzrlib/counted_lock.pyt__repr__)scC@s#|jjƒd|_d|_dS(Ni(Rt
break_lockRRR(R((s7/usr/lib/python2.7/dist-packages/bzrlib/counted_lock.pyR
-s
	cC@s0y|jjƒdk	SWntk
r+tSXdS(sáReturn physical lock status.

        Returns true if a lock is held on the transport. If no lock is held, or
        the underlying locking mechanism does not support querying lock
        status, false is returned.
        N(RtpeekRtNotImplementedErrortFalse(R((s7/usr/lib/python2.7/dist-packages/bzrlib/counted_lock.pytget_physical_lock_status2s
cC@s
|jdk	S(N(RR(R((s7/usr/lib/python2.7/dist-packages/bzrlib/counted_lock.pyt	is_locked>scC@s>|jr|jd7_n|jjƒd|_d|_dS(sÝAcquire the lock in read mode.

        If the lock is already held in either read or write mode this
        increments the count and succeeds.  If the lock is not already held,
        it is taken in read mode.
        itrN(RRRt	lock_read(R((s7/usr/lib/python2.7/dist-packages/bzrlib/counted_lock.pyRAs
	
	cC@s‘|jdkrF|jjd|ƒ|_d|_|jd7_|jS|jdkrgtj|ƒ‚n&|jj|ƒ|jd7_|jSdS(sBAcquire the lock in write mode.

        If the lock was originally acquired in read mode this will fail.

        :param token: If given and the lock is already held, 
            then validate that we already hold the real
            lock with this token.

        :returns: The token from the underlying lock.
        ittokentwiN(RRt
lock_writet_tokenRRt
ReadOnlyErrortvalidate_token(RR((s7/usr/lib/python2.7/dist-packages/bzrlib/counted_lock.pyROs	cC@sk|jdkr!tj|ƒ‚nF|jdkrXd|_|jd8_|jjƒn|jd8_dS(Nii(RRtLockNotHeldRRRtunlock(R((s7/usr/lib/python2.7/dist-packages/bzrlib/counted_lock.pyRfs	N(Rt
__module__t__doc__R	RR
RRRRRR(((s7/usr/lib/python2.7/dist-packages/bzrlib/counted_lock.pyRs						N(Rt
__future__RtbzrlibRtobjectR(((s7/usr/lib/python2.7/dist-packages/bzrlib/counted_lock.pyt<module>s

Copyright © 2017 || Recoded By Mr.Bumblebee