-=[ Mr. Bumblebee ]=-
_Indonesia_

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

σ
ΉΰνNc@@sEddlmZddlZddlZdejfd„ƒYZdS(i(tabsolute_importNtCatchingExceptionThreadcB@s}eZdZd„Zejd
krBeejj	ejj
ƒZnd„Zd„Z
d„Zd„Zdd„Zd	„ZRS(s‘A thread that keeps track of exceptions.

    If an exception occurs during the thread execution, it's caught and
    re-raised when the thread is joined().
    cO@s~y|jdƒ}Wntk
r2tjƒ}nXtt|ƒj||Ž|j|ƒd|_	d|_
tjƒ|_dS(Nt
sync_event(
tpoptKeyErrort	threadingtEventtsuperRt__init__tset_sync_eventtNonet	exceptiontignored_exceptionstLocktlock(tselftargstkwargsR((s3/usr/lib/python2.7/dist-packages/bzrlib/cethread.pyRs

		iicC@s
||_dS(scSet the ``sync_event`` event used to synchronize exception catching.

        When the thread uses an event to synchronize itself with another thread
        (setting it when the other thread can wake up from a ``wait`` call),
        the event must be set after catching an exception or the other thread
        will hang.

        Some threads require multiple events and should set the relevant one
        when appropriate.

        Note that the event should be initially cleared so the caller can
        wait() on him and be released when the thread set the event.

        Also note that the thread can use multiple events, setting them as it
        progress, while the caller can chose to wait on any of them. What
        matters is that there is always one event set so that the caller is
        always released when an exception is caught. Re-using the same event is
        therefore risky as the thread itself has no idea about which event the
        caller is waiting on. If the caller has already been released then a
        cleared event won't guarantee that the caller is still waiting on it.
        N(R(Rtevent((s3/usr/lib/python2.7/dist-packages/bzrlib/cethread.pyR	2scC@sd|j}|jjƒz9y|j|ƒWn|j|ƒ‚nX|jƒWd|jjƒXdS(sSwitch to a new ``sync_event`` and set the current one.

        Using this method protects against race conditions while setting a new
        ``sync_event``.

        Note that this allows a caller to wait either on the old or the new
        event depending on whether it wants a fine control on what is happening
        inside a thread.

        :param new: The event that will become ``sync_event``
        N(RRtacquireR	tsettrelease(Rtnewtcur((s3/usr/lib/python2.7/dist-packages/bzrlib/cethread.pytswitch_and_setJs	

c@sOˆdkrd|_n3tˆttfƒrB‡fd†|_n	ˆ|_dS(sάDeclare which exceptions will be ignored.

        :param ignored: Can be either:
        
           - None: all exceptions will be raised,
           - an exception class: the instances of this class will be ignored,
           - a tuple of exception classes: the instances of any class of the
             list will be ignored,
           - a callable: that will be passed the exception object
             and should return True if the exception should be ignored
        c@s
t|ˆƒS(N(t
isinstance(te(tignored(s3/usr/lib/python2.7/dist-packages/bzrlib/cethread.pyt<lambda>wsN(R
RRt	Exceptionttuple(RR((Rs3/usr/lib/python2.7/dist-packages/bzrlib/cethread.pytset_ignored_exceptionshs
cC@sV|jjƒz4ytt|ƒjƒWntjƒ|_nXWd|jjƒXdS(s.Overrides Thread.run to capture any exception.N(	RtclearRRtruntsystexc_infoRR(R((s3/usr/lib/python2.7/dist-packages/bzrlib/cethread.pyR!{s
cC@sutt|ƒj|ƒ|jdk	rq|j\}}}d|_|jdks_|j|ƒrq|||‚qqndS(s³Overrides Thread.join to raise any exception caught.

        Calling join(timeout=0) will raise the caught exception or return None
        if the thread is still alive.
        N(RRtjoinRR
R(Rttimeoutt	exc_classt	exc_valuetexc_tb((s3/usr/lib/python2.7/dist-packages/bzrlib/cethread.pyR$ˆs	cC@s|jddƒdS(sYRaise the caught exception.

        This does nothing if no exception occurred.
        R%iN(R$(R((s3/usr/lib/python2.7/dist-packages/bzrlib/cethread.pytpending_exception—s(iiN(t__name__t
__module__t__doc__RR"tversion_infotpropertyRtThreadtgetNametsetNametnameR	RRR!R
R$R)(((s3/usr/lib/python2.7/dist-packages/bzrlib/cethread.pyRs					
(t
__future__RR"RR/R(((s3/usr/lib/python2.7/dist-packages/bzrlib/cethread.pyt<module>s

Copyright © 2017 || Recoded By Mr.Bumblebee