403Webshell
Server IP : 61.19.30.66  /  Your IP : 216.73.216.15
Web Server : Apache/2.2.22 (Ubuntu)
System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64
User : www-data ( 33)
PHP Version : 5.3.10-1ubuntu3.48
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python2.7/dist-packages/twisted/python/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/dist-packages/twisted/python/failure.pyc
ó
@Nc@sKdZddlZddlZddlZddlZddlmZddlmZddlm	Z	da
dZdefd	„ƒYZ
d
d„ZdZd
efd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdfd„ƒYZd„ZeZeeeeejjd„Zd„ZddlZdS(s9
Asynchronous-friendly error mechanism.

See L{Failure}.
i˙˙˙˙N(tStringIO(tgetmro(treflectiitDefaultExceptioncBseZRS((t__name__t
__module__(((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pyRstdefaultcCsä|dkr"td|fƒ‚n|}|dkrnxŠ|D],\}}}}}|d|||fƒq;Wnr|dkrÔxc|D]L\}}}}}|d|||fƒ|dtj||ƒjƒƒqWn|dkr$x4|D],\}}}}}|d	|||fƒqçW|d
ƒnź|dkrŕx­|D]˘\}}}}}|d	|||fƒ|dƒx.|D]&\}	}
|d|	t|
ƒfƒqtW|d
ƒx.|D]&\}	}
|d|	t|
ƒfƒqŻWq7WndS(s“Format and write frames.

    @param frames: is a list of frames as used by Failure.frames, with
        each frame being a list of
        (funcName, fileName, lineNumber, locals.items(), globals.items())
    @type frames: list
    @param write: this will be called with formatted strings.
    @type write: callable
    @param detail: Four detail levels are available:
        default, brief, verbose, and verbose-vars-not-captured.
        C{Failure.printDetailedTraceback} uses the latter when the caller asks
        for verbose, but no vars were captured, so that an explicit warning
        about the missing data is shown.
    @type detail: string
    Rtbrieftverbosesverbose-vars-not-capturedsNDetail must be default, brief, verbose, or verbose-vars-not-captured. (not %r)s	%s:%s:%s
s  File "%s", line %s, in %s
s    %s
s%s:%d: %s(...)
sA [Capture of Locals and Globals disabled (use captureVars=True)]
s [ Locals ]
s
  %s : %s
s
 ( Globals )
N(sdefaultRsverbosesverbose-vars-not-captured(t
ValueErrort	linecachetgetlinetstriptrepr(tframestwritetdetailtwtmethodtfilenametlinenot	localVarst
globalVarstnametval((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pyt
format_framess4	'


s--- <exception caught here> ---tNoCurrentExceptionErrorcBseZdZRS(sŠ
    Raised when trying to create a Failure from the current interpreter
    exception state and there is no current exception state.
    (RRt__doc__(((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pyRPst
_TracebackcBseZdZd„ZRS(sq
    Fake traceback object which can be passed to functions in the standard
    library L{traceback} module.
    cCs”t|ƒdkstdƒ‚|d|d}}|\}}}}}t||ƒ|_||_t|ƒdkrd|_nt|ƒ|_dS(s]
        Construct a fake traceback object using a list of frames. Note that
        although frames generally include locals and globals, this information
        is not kept by this object, since locals and globals are not used in
        standard tracebacks.

        @param frames: [(methodname, filename, lineno, locals, globals), ...]
        isMust pass some framesiN(tlentAssertionErrort_Framettb_framet	tb_linenotNonettb_nextR(tselfRtheadRRRtlocalztglobalz((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pyt__init__]s		(RRRR((((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pyRWsRcBseZdZd„ZRS(sč
    A fake frame object, used by L{_Traceback}.

    @ivar f_code: fake L{code<types.CodeType>} object
    @ivar f_globals: fake f_globals dictionary (usually empty)
    @ivar f_locals: fake f_locals dictionary (usually empty)
    cCs(t||ƒ|_i|_i|_dS(sŤ
        @param name: method/function name for this frame.
        @type name: C{str}
        @param filename: filename for this frame.
        @type name: C{str}
        N(t_Codetf_codet	f_globalstf_locals(R$RR((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pyR(zs	(RRRR((((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pyRqsR)cBseZdZd„ZRS(sB
    A fake code object, used by L{_Traceback} via L{_Frame}.
    cCs||_||_dS(N(tco_nametco_filename(R$RR((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pyR(Šs	(RRRR((((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pyR)†stFailurecBsůeZdZdZdZeejdƒZ	ddde
d„Zd„Zd„Z
d„Zd„Zd„ZeeƒZd	„Zd
„Zd„Zd„Zd
„Zd„Zd„Zddd„Zde
dd„Zddd„Zddd„ZRS(sě
    A basic abstraction for an error that has occurred.

    This is necessary because Python's built-in error mechanisms are
    inconvenient for asynchronous communication.

    The C{stack} and C{frame} attributes contain frames.  Each frame is a tuple
    of (funcName, fileName, lineNumber, localsItems, globalsItems), where
    localsItems and globalsItems are the contents of
    C{locals().items()}/C{globals().items()} for that frame, or an empty tuple
    if those details were not captured.

    @ivar value: The exception instance responsible for this failure.
    @ivar type: The exception's class.
    @ivar stack: list of frames, innermost last, excluding C{Failure.__init__}.
    @ivar frames: list of frames, innermost first.
    itYIELD_VALUEc	Cstdat|_d|_|_}||_t|ttfƒr†|dkr†ddl}|j	d|t
ddƒt|ƒ}nd}|dkr§|jƒ}n|dkrňt
jƒ\|_|_}|jdkrétƒ‚nd}nW|dkr7t|tƒr|j|_nt|ƒ|_||_n||_||_t|jtƒrn|jj|_dS|dkrŒ|rŒ|}qŒng}|_g}	|_||_|rÁ|j}
nt|jtƒsŕd}
}nx#|r|
r|
j}
|d8}qăWxŇ|
rÚ|r–|
jjƒ}|
j|
jkr?i}n|
jjƒ}x*||fD]}
d|
kr[|
d=q[q[W|jƒ}|jƒ}n
d	}}|	jd|
jj|
jj |
j!||fƒ|
j}
q	WxŢ|dk	rť|j}
|rz|
jjƒ}|
j|
jkr#i}n|
jjƒ}x*||fD]}
d|
kr?|
d=q?q?W|jƒ}|jƒ}n
d
}}|j"|
jj|
jj |j#||fƒ|j$}qŢWt%j&|jƒrt'|jtƒrt(|jƒ}t)t*j+|ƒ|_,n|jg|_,dS(s-
        Initialize me with an explanation of the error.

        By default, this will use the current C{exception}
        (L{sys.exc_info}()).  However, if you want to specify a
        particular kind of failure, you can pass an exception as an
        argument.

        If no C{exc_value} is passed, then an "original" C{Failure} will
        be searched for. If the current exception handler that this
        C{Failure} is being constructed in is handling an exception
        raised by L{raiseException}, then this C{Failure} will act like
        the original C{Failure}.

        For C{exc_tb} only L{traceback} instances or C{None} are allowed.
        If C{None} is supplied for C{exc_value}, the value of C{exc_tb} is
        ignored, otherwise if C{exc_tb} is C{None}, it will be found from
        execution context (ie, L{sys.exc_info}).

        @param captureVars: if set, capture locals and globals of stack
            frames.  This is pretty slow, and makes no difference unless you
            are going to use L{printDetailedTraceback}.
        ii˙˙˙˙NsTDon't pass strings (like %r) to failure.Failure (replacing with a DefaultException).t
stackleveliit__builtins__(((-tcountR"ttypetvaluetcaptureVarst
isinstancetstrtunicodetwarningstwarntDeprecationWarningRt_findFailuretsystexc_infoRt	Exceptiont	__class__R/t__dict__RtstackttbR tf_backR,tcopyR+titemstinsertR*R-R.tf_linenotappendR!R#tinspecttisclasst
issubclassRtmapRtqualtparents(R$t	exc_valuetexc_typetexc_tbR6RDR:tstackOffsetRRCtfR&R'tdtparentCs((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pyR(Şs¨
		!			

	
	
		
			

		
		

$cGs"|j|Œ}|s|‚n|S(sTrap this failure if its type is in a predetermined list.

        This allows you to trap a Failure in an error callback.  It will be
        automatically re-raised if it is not a type that you expect.

        The reason for having this particular API is because it's very useful
        in Deferred errback chains::

            def _ebFoo(self, failure):
                r = failure.trap(Spam, Eggs)
                print 'The Failure is due to either Spam or Eggs!'
                if r == Spam:
                    print 'Spam did it!'
                elif r == Eggs:
                    print 'Eggs did it!'

        If the failure is not a Spam or an Eggs, then the Failure
        will be 'passed on' to the next errback.

        @type errorTypes: L{Exception}
        (tcheck(R$t
errorTypesterror((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pyttrapBs	cGs^xW|D]O}|}tj|ƒrCt|tƒrCtj|ƒ}n||jkr|SqWdS(súCheck if this failure's type is in a predetermined list.

        @type errorTypes: list of L{Exception} classes or
                          fully-qualified class names.
        @returns: the matching L{Exception} type, or None if no match.
        N(RKRLRMR@RRORPR"(R$RYRZterr((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pyRX]s
cCs|j|j|j‚dS(sf
        raise the original exception, preserving traceback
        information if available.
        N(R4R5RD(R$((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pytraiseExceptionmscCs|j|j|j|jƒS(sJ
        Throw the original exception into the given generator,
        preserving traceback information if available.

        @return: The next value yielded from the generator.
        @raise StopIteration: If there are no more values in the generator.
        @raise anything else: Anything that the generator raises.
        (tthrowR4R5RD(R$tg((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pytthrowExceptionIntoGeneratorus	cCstjƒd}|sdSd}|}x|jrD|}|j}q)W|j}|j|jjkrs|jj	dƒS|jj
sœ|jj
|j|jkr dS|r×|j}|j|j
jkr×|jj	dƒSn|jj}|r|j|j
jkr|jj	dƒSdS(sV
        Find the failure that represents the exception currently in context.
        i˙˙˙˙NR$(R>R?R"R#R R*R]t	func_codeR,tgettco_codettb_lastit_yieldOpcodeR`RE(tclsRDtsecondLastTbtlastTbt	lastFrametframe((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pyR=s*
		
	cCsd|j|jfS(Ns<%s %s>(RAR4(R$((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pyt__repr__ťscCsd|jƒS(Ns[Failure instance: %s](tgetBriefTraceback(R$((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pyt__str__žsc	Csç|jr|jS|jjƒ}g|jD];}|d|d|dt|dƒt|dƒg^q)|d<d
|d<|jd
k	rŮg|jD];}|d|d|dt|dƒt|dƒg^q‘|d<nd|d	<|S(s1Avoid pickling objects in the traceback.
        iiiiiRRDRCtpickledN(RnRBRFRt
_safeReprVarsR"RC(R$tctv((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pyt__getstate__Ás	L
O
cCs|jƒ|_dS(sIRemove references to other objects, replacing them with strings.
        N(RrRB(R$((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pytcleanFailureáscCs@|jdk	r|jSt|jƒdkr8t|jƒSdSdS(s‘
        Get an object that represents this Failure's stack that can be passed
        to traceback.extract_tb.

        If the original traceback object is still present, return that. If this
        traceback object has been lost but we still have the information,
        return a fake traceback object (see L{_Traceback}). If there is no
        traceback information at all, return None.
        iN(RDR"RRR(R$((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pytgetTracebackObjectćs


cCs/t|jtƒr|jjƒStj|jƒS(s8Get a string of the exception which caused this Failure.(R7R5R/tgetErrorMessageRtsafe_str(R$((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pyRu÷s
cCs#tƒ}|jd|ƒ|jƒS(Ntfile(RtprintBriefTracebacktgetvalue(R$tio((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pyRlýs	RcCs/tƒ}|jd|d|d|ƒ|jƒS(NRwtelideFrameworkCodeR(RtprintTracebackRy(R$R{RRz((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pytgetTracebacks	cCs|dkrtj}n|j}|dkr@|jr@d}n|}|dkr{|d|j|jrmdppdfƒn`|dkrŃ|jr™d}nd}|d	|tj	|j
ƒtj	|jƒfƒn
|d
ƒ|jr,|st|j
t||ƒ|dtfƒnt|j||ƒn|dksE|dƒn|dksŹt|j
ttfƒr}||j
d
ƒqŹ|dtj|j
ƒtj	|jƒfƒnt|jtƒrä|jdƒ|jj|||ƒn|dkr|d|jƒndS(s
        Emulate Python's standard error reporting mechanism.

        @param file: If specified, a file-like object to which to write the
            traceback.

        @param elideFrameworkCode: A flag indicating whether to attempt to
            remove uninteresting frames from within Twisted itself from the
            output.

        @param detail: A string indicating how much information to include
            in the traceback.  Must be one of C{'brief'}, C{'default'}, or
            C{'verbose'}.
        Rsverbose-vars-not-captureds*--- Failure #%d%s---
s (pickled) t Rt	Tracebacks"Traceback (failure with no frames)s%s: %s: %s
s#Traceback (most recent call last):
s%s
s	Failure: s
s%s: %s
s (chained Failure)
s*--- End of Failure #%d ---
N(R"tlogtlogerrRR6R3RnRRRvR4R5RRCt
traceupLengthtEXCEPTION_CAUGHT_HERER7R8R9ROR/R|(R$RwR{RRtformatDetailt	hasFrames((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pyR|sH				
	

cCs|j||ddƒdS(s2Print a traceback as densely as possible.
        RRN(R|(R$RwR{((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pyRxSscCs|j||ddƒdS(sHPrint a traceback with detailed locals and globals information.
        RRN(R|(R$RwR{((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pytprintDetailedTracebackXsN(RRRRnR"RCtchrtopcodetopmapRetFalseR(R[RXR]R`R=tclassmethodRkRmRrRsRtRuRlR}R|RxR†(((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pyR/s.	—					8			 				KcCs,g|D]!\}}|tj|ƒf^qS(sq
    Convert a list of (name, object) pairs into (name, repr) pairs.

    L{twisted.python.reflect.safe_repr} is used to generate the repr, so no
    exceptions will be raised by faulty C{__repr__} methods.

    @param varsDictItems: a sequence of (name, value) pairs as returned by e.g.
        C{locals().items()}.
    @returns: a sequence of (name, repr) pairs.
    (Rt	safe_repr(t
varsDictItemsRtobj((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pyRo^sc	Cs¨|||fdkrŽtjƒ}|d|jkrŽtrŽyt|dƒ}Wn
d}nXd|fGHddl}|j|dƒqŽn||||||ƒdS(	s;
    Initialize failure object, possibly spawning pdb.
    iis
broken strs8Jumping into debugger for post-mortem of exception '%s':i˙˙˙˙Ni(NNN(R"R>R?RAtDO_POST_MORTEMR8tpdbtpost_mortem(	R$RQRRRSR6tFailure__init__texctstrreprR((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pyt
_debuginitps
cCs
tt_dS(s Enable debug hooks for Failures.N(R•R/R((((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pytstartDebugModeƒs( RR>R
RKRˆt	cStringIORRttwisted.pythonRR3R‚R@RRRƒRtobjectRRR)R/RotTrueRR"RŠR(tim_funcR•R–R€(((s:/usr/lib/python2.7/dist-packages/twisted/python/failure.pyt<module>s2.	˙Đ			

Youez - 2016 - github.com/yon3zu
LinuXploit