-=[ Mr. Bumblebee ]=-
_Indonesia_

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

ó
¹àíNc@@spddlmZddlmZeeƒdƒddlmZdefd„ƒYZdefd„ƒYZ	d	S(
i(tabsolute_import(tlazy_imports‚
import warnings

from bzrlib import (
    counted_lock,
    errors,
    lock,
    osutils,
    transactions,
    urlutils,
    )
(tonly_raisest
LockableFilescB@sÑeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zdd
„Z
d„Zd„Zd
„Zeejejƒd„ƒZd„Zd„Zd„Zd„Zd„ZRS(sTObject representing a set of related files locked within the same scope.

    This coordinates access to the lock along with providing a transaction.

    LockableFiles manage a lock count and can be locked repeatedly by
    a single caller.  (The underlying lock implementation generally does not
    support this.)

    Instances of this class are often called control_files.

    This class is now deprecated; code should move to using the Transport
    directly for file operations and using the lock or CountedLock for
    locking.

    :ivar _lock: The real underlying lock (e.g. a LockDir)
    :ivar _lock_count: If _lock_mode is true, a positive count of the number
        of times the lock has been taken (and not yet released) *by this
        process*, through this particular object instance.
    :ivar _lock_mode: None, or 'r' or 'w'
    cC@sƒ||_||_d|_d|_d|_|jƒ|j|ƒ}|||d|jd|j	ƒ|_
tj|j
ƒ|_
dS(sFCreate a LockableFiles group

        :param transport: Transport pointing to the directory holding the
            control files and lock.
        :param lock_name: Name of the lock guarding these files.
        :param lock_class: Class of lock strategy to use: typically
            either LockDir or TransportLock.
        it
file_modebitstdir_modebitsN(t
_transportt	lock_nametNonet_transactiont
_lock_modet_lock_countt_find_modest_escapet
_file_modet	_dir_modet_locktcounted_locktCountedLockt
_counted_lock(tselft	transportRt
lock_classtesc_name((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyt__init__<s						
	cC@s|jjd|jƒdS(s‰Create the lock.

        This should normally be called only when the LockableFiles directory
        is first created on disk.
        tmodeN(RtcreateR(R((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pytcreate_lockQscC@sd|jj|jfS(Ns%s(%r)(t	__class__t__name__R(R((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyt__repr__YscC@sd|j|jjfS(NsLockableFiles(%s, %s)(RRtbase(R((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyt__str__]scC@s|jjƒdS(s‘Break the lock of this lockable files group if it is held.

        The current ui factory will be used to prompt for user conformation.
        N(Rt
break_lock(R((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyR!`scC@sGt|tƒs!dj|ƒ}n|dkr1dStjtj|ƒƒS(s)DEPRECATED: Do not use outside this classt/tu(t
isinstancet
basestringtjointurlutilstescapetosutilstsafe_unicode(Rtfile_or_path((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyR
gs
cC@sgy|jjdƒ}Wn&tjk
r>d|_d|_n%X|jd@dB|_|jd@|_dS(	s‚Determine the appropriate modes for files and directories.

        :deprecated: Replaced by BzrDir._find_creation_modes.
        t.iíi¤iÿiÀiINi¶ñÿÿ(RtstatterrorstTransportNotPossibleRRtst_mode(Rtst((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyRos	
cC@s|jjƒdS(s@Set this LockableFiles to not clear the physical lock on unlock.N(Rtleave_in_place(R((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyR2…scC@s|jjƒdS(s<Set this LockableFiles to clear the physical lock on unlock.N(Rtdont_leave_in_place(R((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyR3‰scC@s¥|jrc|jdks+|jƒjƒr=tj|ƒ‚n|jj|ƒ|jd7_|jS|jj	d|ƒ}d|_d|_|j
ƒ||_|SdS(sžLock this group of files for writing.

        :param token: if this is already locked, then lock_write will fail
            unless the token matches the existing lock.
        :returns: a token if this instance supports tokens, otherwise None.
        :raises TokenLockingNotSupported: when a token is given but this
            instance doesn't support using token locks.
        :raises MismatchedToken: if the specified token doesn't match the token
            of the existing lock.

        A token should be passed in if you know that you have locked the object
        some other way, and need to synchronise this object's state with that
        fact.
        twittokenN(R
tget_transactiont	writeableR.t
ReadOnlyErrorRtvalidate_tokenRt_token_from_lockt
lock_writet_set_write_transaction(RR5ttoken_from_lock((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyR;s			
	cC@sp|jrC|jdkr1td|jfƒ‚n|jd7_n)|jjƒd|_d|_|jƒdS(NtrR4sinvalid lock mode %ri(R>R4(R
t
ValueErrorRRt	lock_readt_set_read_transaction(R((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyR@¬s	
		cC@s*|jtjƒƒ|jƒjdƒdS(sSetup a read transaction.iˆN(t_set_transactionttransactionstReadOnlyTransactionR6tset_cache_size(R((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyRA¸scC@s|jtjƒƒdS(sSetup a write transaction.N(RBRCtWriteTransaction(R((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyR<¾scC@sj|jstj|ƒS|jdkr7|jd8_n/|jƒz|jjƒWdd|_|_XdS(Ni(R
tlocktcant_unlock_not_heldRt_finish_transactionRtunlockR(R((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyRJÂs	

cC@s
|jdkS(s1Return true if this LockableFiles group is lockedi(R(R((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyt	is_lockedÐscC@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((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pytget_physical_lock_statusÔs
cC@s$|jdkrtjƒS|jSdS(sÁReturn the current active transaction.

        If no transaction is active, this returns a passthrough object
        for which all data is immediately flushed and no caching happens.
        N(R	RRCtPassThroughTransaction(R((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyR6às
cC@s2|jdk	r%tjd|ƒ‚n||_dS(sSet a new active transaction.s&Branch %s is in a transaction already.N(R	RR.t	LockError(Rtnew_transaction((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyRBës	
cC@sE|jdkr%tjd|ƒ‚n|j}d|_|jƒdS(sExit the current transaction.s!Branch %s is not in a transactionN(R	RR.RQtfinish(Rttransaction((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyRIòs	
		N(Rt
__module__t__doc__RRRR R!R
RR2R3RR;R@RAR<RR.tLockNotHeldt
LockBrokenRJRKROR6RBRI(((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyR&s(																t
TransportLockcB@sneZdZd„Zd„Zd„Zd„Zdd„Zd„Z	d„Z
d„Zdd	„Zd
„Z
RS(s)Locking method which uses transport-dependent locks.

    On the local filesystem these transform into OS-managed locks.

    These do not guard against concurrent access via different
    transports.

    This is suitable for use only in WorkingTrees (which are at present
    always local).
    cC@s(||_||_||_||_dS(N(Rt
_escaped_namet_file_modebitst
_dir_modebits(RRtescaped_nameRR((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyRs			cC@st|jƒ‚dS(N(RMR!(R((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyR!
scC@st|jƒ‚dS(N(RMR2(R((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyR2scC@st|jƒ‚dS(N(RMR3(R((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyR3scC@s:|dk	rtj|ƒ‚n|jj|jƒ|_dS(N(RR.tTokenLockingNotSupportedRR;RZR(RR5((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyR;scC@s|jj|jƒ|_dS(N(RR@RZR(R((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyR@scC@s|jjƒd|_dS(N(RRJR(R((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyRJs
cC@s
tƒ‚dS(N(RM(R((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyRL"scC@s#|jj|jdd|jƒdS(sCreate lock mechanismR#RN(Rt	put_bytesRZR[(RR((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyR%scC@s"|dk	rtj|ƒ‚ndS(N(RR.R^(RR5((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyR9+sN(RRURVRR!R2R3RR;R@RJRLRR9(((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyRYüs
							N(
t
__future__Rtbzrlib.lazy_importRtglobalstbzrlib.decoratorsRtobjectRRY(((s9/usr/lib/python2.7/dist-packages/bzrlib/lockable_files.pyt<module>s	Ö

Copyright © 2017 || Recoded By Mr.Bumblebee