-=[ Mr. Bumblebee ]=-
_Indonesia_

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

ó
î:ïNc@@s@dZddlmZddlmZdefd„ƒYZdS(sInter-object utility class.i(tabsolute_import(tNoCompatibleIntertInterObjectcB@sheZdZd„Zd„Zed„ƒZd„Zd„Zed„ƒZ	d„Z
ed„ƒZRS(	sµThis class represents operations taking place between two objects.

    Its instances have methods like join or copy_content or fetch, and contain
    references to the source and target objects these operations can be
    carried out between.

    Often we will provide convenience methods on the objects which carry out
    operations with another of similar type - they will always forward to
    a subclass of InterObject - i.e.
    InterVersionedFile.get(other).method_name(parameters).

    If the source and target objects implement the locking protocol -
    lock_read, lock_write, unlock, then the InterObject's lock_read,
    lock_write and unlock methods may be used (optionally in conjunction with
    the needs_read_lock and needs_write_lock decorators.)

    When looking for an inter, the most recently registered types are tested
    first.  So typically the most generic and slowest InterObjects should be
    registered first.
    cC@s||_||_dS(s¥Construct a default InterObject instance. Please use 'get'.

        Only subclasses of InterObject should call
        InterObject.__init__ - clients should call InterFOO.get where FOO
        is the base type of the objects they are interacting between. I.e.
        InterVersionedFile or InterRepository.
        get() is a convenience class method which will create an optimised
        InterFOO if possible.
        N(tsourcettarget(tselfRR((s0/usr/lib/python2.7/dist-packages/bzrlib/inter.pyt__init__1s
	cC@s:|ƒy|ƒWn!tk
r5|jjƒ‚nXdS(s@Take out two locks, rolling back the first if the second throws.N(t	ExceptionRtunlock(Rtlock_sourcetlock_target((s0/usr/lib/python2.7/dist-packages/bzrlib/inter.pyt_double_lock>s

cC@sLx6t|jƒD]%}|j||ƒr|||ƒSqWt||ƒ‚dS(s•Retrieve a Inter worker object for these objects.

        :param source: the object to be the 'source' member of
                       the InterObject instance.
        :param target: the object to be the 'target' member of
                       the InterObject instance.

        If an optimised worker exists it will be used otherwise
        a default Inter worker instance will be created.
        N(treversedt_optimiserst
is_compatibleR(tklassRRtprovider((s0/usr/lib/python2.7/dist-packages/bzrlib/inter.pytgetIscC@s |j|jj|jjƒdS(s§Take out a logical read lock.

        This will lock the source branch and the target branch. The source gets
        a read lock and the target a read lock.
        N(RRt	lock_readR(R((s0/usr/lib/python2.7/dist-packages/bzrlib/inter.pyRZscC@s |j|jj|jjƒdS(s©Take out a logical write lock.

        This will lock the source branch and the target branch. The source gets
        a read lock and the target a write lock.
        N(RRRRt
lock_write(R((s0/usr/lib/python2.7/dist-packages/bzrlib/inter.pyRbscC@s|jj|ƒdS(s"Register an InterObject optimiser.N(R
tappend(Rt	optimiser((s0/usr/lib/python2.7/dist-packages/bzrlib/inter.pytregister_optimiserjscC@s&z|jjƒWd|jjƒXdS(s'Release the locks on source and target.N(RRR(R((s0/usr/lib/python2.7/dist-packages/bzrlib/inter.pyRoscC@s|jj|ƒdS(s$Unregister an InterObject optimiser.N(R
tremove(RR((s0/usr/lib/python2.7/dist-packages/bzrlib/inter.pytunregister_optimiservs(t__name__t
__module__t__doc__RRtclassmethodRRRRRR(((s0/usr/lib/python2.7/dist-packages/bzrlib/inter.pyRs	
				N(Rt
__future__Rt
bzrlib.errorsRtobjectR(((s0/usr/lib/python2.7/dist-packages/bzrlib/inter.pyt<module>s

Copyright © 2017 || Recoded By Mr.Bumblebee