ó
    Ö›‘høY  ã                  ó�  • S r SSKJr  SSKrSSKrSSKrSSKrSSKrSSKJ	r	  SSKJ
r
  SSKJr  SSKJrJrJr  SSKJr  SS	KJr  SS
KJr  \" S\S\4   S9rSqSr " S S\5      rS$S jrSr " S S\5      rS r  " S S5      r! " S S5      r" " S S5      r#/ r$S%S jr% " S S\&5      r'S r(S r)SSSS!\'RT                  4S" jr+S# r,g)&z9
Asynchronous-friendly error mechanism.

See L{Failure}.
é    )ÚannotationsN)Úpartial)Úgetmro)ÚStringIO)ÚCallableÚNoReturnÚTypeVar)ÚVersion)Úreflect)ÚdeprecatedPropertyÚ_T_Callable.)Úboundé   c                  ó   • \ rS rSrSrg)ÚDefaultExceptioné&   © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__static_attributes__r   ó    ÚZC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/python/failure.pyr   r   &   s   † Úr   r   c           
     ód  • US;  a  [        SU< S35      eUnUS:X  a  U  H  u  pEpgnU" U SU SU S35        M     gUS:X  aM  U  HF  u  pEpgnU" SU S	U S
U S35        U" S[        R                  " XV5      R                  5       -  5        MH     gUS:X  a#  U  H  u  pEpgnU" SXVU4-  5        M     U" S5        gUS:X  aq  U  Hj  u  pEpgnU" SXVU4-  5        U" S5        U H  u  pšU" SU	 S[	        U
5       S35        M     U" S5        U H  u  pšU" SU	 S[	        U
5       S35        M     Ml     gg)a`  
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
)ÚdefaultÚbriefÚverboseúverbose-vars-not-capturedzKDetail must be default, brief, verbose, or verbose-vars-not-captured. (not Ú)r   Ú:Ú
r   z  File "z", line z, in z    %s
r   z%s:%d: %s(...)
zA [Capture of Locals and Globals disabled (use captureVars=True)]
r   z [ Locals ]
z  z : z ( Globals )
N)Ú
ValueErrorÚ	linecacheÚgetlineÚstripÚrepr)ÚframesÚwriteÚdetailÚwÚmethodÚfilenameÚlinenoÚ	localVarsÚ
globalVarsÚnameÚvals              r   Úformat_framesr3   *   s„  € ð" ÐQÓQÝã5;ð>ó
ð 	
ð 	€AØ�ÓÛ?EÑ;ˆF˜f°Ù��
˜!˜F˜8 1 V H¨BÐ/Ö0ò @Fà	�9Ó	Û?EÑ;ˆF˜f°Ù�˜˜
 (¨6¨(°%¸°x¸rÐBÔCÙˆjœ9×,Ò,¨XÓ>×DÑDÓFÑFÖGò @Fð 
Ð.Ó	.Û?EÑ;ˆF˜f°ÙÐ  H°fÐ#=Ñ=Ö>ñ @Fá	Ð
NÕOØ	�9Ó	Û?EÑ;ˆF˜f°ÙÐ  H°fÐ#=Ñ=Ô>ÙˆoÔã&‘	�Ù�B�t�f˜C¤ S£	˜{¨"Ð-Ö.ñ 'áÐÔÛ'‘	�Ù�B�t�f˜C¤ S£	˜{¨"Ð-Ö.ó (ò @Fð 
r   z--- <exception caught here> ---c                  ó   • \ rS rSrSrSrg)ÚNoCurrentExceptionErroré\   z~
Raised when trying to create a Failure from the current interpreter
exception state and there is no current exception state.
r   N)r   r   r   r   Ú__doc__r   r   r   r   r5   r5   \   s   † ôr   r5   c                óÒ   • [        U 5      S:”  d   S5       eSn[        U S   U5      n[        U5      =p#U SS  H*  n[        XA5      n[        U5      Ul        UR                  nM,     U$ )zÒ
Construct a fake traceback object using a list of frames.

It should have the same API as stdlib to allow interaction with
other tools.

@param tbFrames: [(methodname, filename, lineno, locals, globals), ...]
r   zMust pass some framesNé   )ÚlenÚ_FrameÚ_TracebackFrameÚtb_next)ÚtbFramesÚstackÚfirstTbÚtbÚsfs        r   Ú
_TracebackrC   c   sx   € ô ˆx‹=˜1ÓÐ5Ð5Ó5Ðð €Eô �8˜A‘; Ó&€EÜ" 5Ó)Ð)€GØ�q�r‹lˆÜ�rÓ!ˆÜ$ UÓ+ˆŒ
Ø�Z‰ZŠñ ð €Nr   c                  ó   • \ rS rSrSrS rSrg)r<   é„   ze
Fake traceback object which can be passed to functions in the standard
library L{traceback} module.
c                ób   • Xl         UR                  U l        UR                  U l        SU l        g)z
@param frame: _Frame object
N)Útb_frameÚf_linenoÚ	tb_linenoÚf_lastiÚtb_lastir=   )ÚselfÚframes     r   Ú__init__Ú_TracebackFrame.__init__Š   s&   € ð ŒØŸ™ˆŒØŸ™ˆŒØˆ�r   )rG   rK   rI   r=   N©r   r   r   r   r7   rN   r   r   r   r   r<   r<   „   s   † ñõ
r   r<   c                  ó   • \ rS rSrSrS rSrg)r;   é”   a(  
A fake frame object, used by L{_Traceback}.

@ivar f_code: fake L{code<types.CodeType>} object
@ivar f_lineno: line number
@ivar f_globals: fake f_globals dictionary (usually empty)
@ivar f_locals: fake f_locals dictionary (usually empty)
@ivar f_back: previous stack frame (towards the caller)
c                ó  • Uu  p4pVn[        X45      U l        XPl        [        U=(       d    0 5      U l        [        U=(       d    0 5      U l        X l        SU l        [        [        5      R                  5       U l        SU l        g)z‚
@param frameinfo: (methodname, filename, lineno, locals, globals)
@param back: previous (older) stack frame
@type back: C{frame}
r   N)Ú_CodeÚf_coderH   ÚdictÚ	f_globalsÚf_localsÚf_backrJ   ÚvarsÚbuiltinsÚcopyÚ
f_builtinsÚf_trace)rL   Ú	frameinfoÚbackr1   r-   r.   ÚlocalzÚglobalzs           r   rN   Ú_Frame.__init__Ÿ   sh   € ð 3<Ñ/ˆ˜¨Ü˜DÓ+ˆŒØŒÜ˜gŸm¨Ó,ˆŒÜ˜VŸ\ rÓ*ˆŒØŒØˆŒÜœx›.×-Ñ-Ó/ˆŒØˆ�r   )rY   r]   rU   rW   rJ   rH   rX   r^   NrP   r   r   r   r;   r;   ”   s   † ñõr   r;   c                  ó$   • \ rS rSrSrS rS rSrg)rT   é°   z¹
A fake code object, used by L{_Traceback} via L{_Frame}.

It is intended to have the same API as the stdlib code type to allow
interoperation with other tools based on that interface.
c                óà   • Xl         X l        SU l        SU l        SU l        / U l        SU l        SU l        SU l        SU l	        SU l
        SU l        SU l        SU l        SU l        SU l        g )Nr   r   r   )Úco_nameÚco_filenameÚ	co_lnotabÚco_firstlinenoÚco_argcountÚco_varnamesÚco_codeÚco_cellvarsÚ	co_constsÚco_flagsÚco_freevarsÚco_posonlyargcountÚco_kwonlyargcountÚco_namesÚ
co_nlocalsÚco_stacksize)rL   r1   r-   s      r   rN   Ú_Code.__init__¸   sw   € ØŒØ#ÔØˆŒØˆÔØˆÔØˆÔØˆŒØˆÔØˆŒØˆŒØˆÔØ"#ˆÔØ!"ˆÔØˆŒØˆŒØˆÕr   c                ó   • g)N))NNNNr   ©rL   s    r   Úco_positionsÚ_Code.co_positionsÊ   s   € Ø*r   )rk   rn   rm   ro   rh   rj   rp   rq   rs   ri   rg   rt   ru   rr   rv   rl   N)r   r   r   r   r7   rN   rz   r   r   r   r   rT   rT   °   s   † ñòõ$+r   rT   c                óD   • [         R                  U R                  5        U $ )zë
Mark the given callable as extraneous to inlineCallbacks exception
reporting; don't show these functions.

@param f: a function that you NEVER WANT TO SEE AGAIN in ANY TRACEBACK
    reported by Failure.

@type f: function

@return: f
)Ú_inlineCallbacksExtraneousÚappendÚ__code__)Úfs    r   Ú_extraneousr�   Ñ   s   € ô ×%Ñ% a§j¡jÔ1Ø€Hr   c                  ó–  • \ rS rSrSrSrSrS#S jr\S 5       r	\	R                  S 5       r	\" \" SS	S
S5      5      S 5       r\R                  S 5       r\S 5       r\R                  S 5       rS r\S$S j5       rS rS rS%S jr\S 5       rS&S jrS&S jrS rS rS rS rS rS&S jrS&S jrS'S(S jjr S)S jr!S*S  jr"S*S! jr#S"r$g)+ÚFailureéá   a…  
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{frame} attribute contain the traceback 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.

Local/global variables in C{frame} will only be captured if
C{captureVars=True} when constructing the L{Failure}.

@ivar value: The exception instance responsible for this failure.

@ivar type: The exception's class.

@ivar stack: Deprecated, always an empty list.  Equivalent information can
    be extracted from C{import traceback;
    traceback.extract_stack(your_failure.tb)}

@ivar frames: list of frames, innermost first.
r   Nc                ón  • [         S-   q [         U l         S=U l        =U l        nX@l        Uc;  [        R
                  " 5       u  U l        U l        nU R                  c
  [        5       eOMUc>  [        U[        5      (       a  UR                  U l        O[        U5      U l        Xl        OX l        Xl        [        U R                  [        5      (       a  U R                  U R                  5        gUc<  U(       a  UnO2[        U R                  SS5      (       a  U R                  R                  nXPl        g)a�  
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 L{None} are allowed.
If L{None} is supplied for C{exc_value}, the value of C{exc_tb} is
ignored, otherwise if C{exc_tb} is L{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}.
r9   NÚ__traceback__)ÚcountÚtypeÚvalueÚcaptureVarsÚsysÚexc_infor5   Ú
isinstanceÚ	ExceptionÚ	__class__rƒ   Ú_extrapolateÚgetattrr†   rA   )rL   Ú	exc_valueÚexc_typeÚexc_tbrŠ   rA   s         r   rN   ÚFailure.__init__ÿ   s÷   € ô2 ˜‘	ˆÜˆŒ
Ø&*Ð*ˆŒ	Ð*�D”J Ø&ÔàÑÜ(+¯ª«Ñ%ˆDŒI�t”z 2Ø�y‰yÑ Ü-Ó/Ð/ð !àÑÜ˜)¤Y×/Ñ/Ø%×/Ñ/�•	ô ! ›O�”	Ø"�Jà ŒIØ"ŒJä�d—j‘j¤'×*Ñ*Ø×Ñ˜dŸj™jÔ)Øà‰:ÞØ‘Ü˜Ÿ™ _°d×;Ñ;à—Z‘Z×-Ñ-�Ø�r   c                ó”  • [        U S5      (       a  U R                  $ / =ol        U R                  nUGb  UR                  nU R                  (       a˜  UR
                  R                  5       nUR
                  UR                  L a  0 nOUR                  R                  5       nXT4 H  nSU;   d  M  US	 M     [        UR                  5       5      n[        UR                  5       5      nOS=pEUR                  UR                  R                  UR                  R                  UR                  UU45        UR                  nUb  GM  U$ )NÚ_framesÚ__builtins__r   )Úhasattrr—   rA   rG   rŠ   rX   r\   rW   ÚlistÚitemsr~   rU   rg   rh   rI   r=   )rL   r(   rA   r€   ra   rb   Úds          r   r(   ÚFailure.frames8  s  € ä�4˜×#Ñ#Ø—<‘<Ðà "Ð"ˆ”Ø�W‰WˆàŠnØ—‘ˆAØ××ØŸ™Ÿ™Ó*�Ø—:‘: §¡Ò,Ø ‘GàŸk™k×.Ñ.Ó0�GØ ›�AØ%¨Õ*Ø˜nÒ-ñ )ô ˜fŸl™l›nÓ-�Ü˜wŸ}™}›Ó/‘à#%Ð%�Ø�M‰Mà—H‘H×$Ñ$Ø—H‘H×(Ñ(Ø—L‘LØØðôð —‘ˆBð1 Œnð2 ˆr   c                ó   • Xl         g ©N)r—   )rL   r(   s     r   r(   r�   [  s   € à�r   ÚTwistedé   é
   c                ó   • / $ rŸ   r   ry   s    r   r?   ÚFailure.stack_  s   € àˆ	r   c                ó   • Ag rŸ   r   )rL   r?   s     r   r?   r¤   c  s   € ár   c                óŠ  • U R                   b  U R                   $ [        R                  " U R                  5      (       ah  [	        U R                  [
        5      (       aI  [        U R                  5      n[        [        [        R                  U5      5      U l         U R                   $ U R                  /U l         U R                   $ rŸ   )Ú_parentsÚinspectÚisclassrˆ   Ú
issubclassrŽ   r   rš   Úmapr   Úqual)rL   ÚparentCss     r   ÚparentsÚFailure.parentsg  sƒ   € à�=‰=Ñ$Ø—=‘=Ð ä�?Š?˜4Ÿ9™9×%Ñ%¬*°T·Y±YÄ	×*JÑ*JÜ˜dŸi™iÓ(ˆHÜ ¤¤W§\¡\°8Ó!<Ó=ˆDŒMð �}‰}Ðð "ŸY™Y˜KˆDŒMØ�}‰}Ðr   c                ó   • Xl         g rŸ   )r§   )rL   r®   s     r   r®   r¯   s  s   € à�r   c                óN   • [         R                   " UR                  5      U l        g)zü
Extrapolate from one failure into another, copying its stack frames.

@param otherFailure: Another L{Failure}, whose traceback information,
    if any, should be preserved as part of the stack presented by this
    one.
@type otherFailure: L{Failure}
N)r\   Ú__dict__)rL   ÚotherFailures     r   r�   ÚFailure._extrapolatew  s   € ô Ÿ	š	 ,×"7Ñ"7Ó8ˆ�r   c                óª   • [         R                  [         5      n[        S-  qSUl        [        Ul        Xl        U R
                  Ul        SUl        U$ )zˆ
Create a L{Failure} for an exception without a traceback.

By restricting the inputs significantly, this constructor runs much
faster.
r9   FN)rƒ   Ú__new__r‡   rŠ   r‰   r�   rˆ   rA   )r‰   Úresults     r   Ú_withoutTracebackÚFailure._withoutTracebackƒ  sF   € ô —‘¤Ó)ˆä�‰
ˆØ"ˆÔÜˆŒØŒØ—o‘oˆŒØˆŒ	Øˆr   c                óR   • U R                   " U6 nU(       d  U R                  5         U$ )aø  
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. In Python 2 the Failure will be
raised; in Python 3 the underlying exception will be re-raised.

@type errorTypes: L{Exception}
)ÚcheckÚraiseException)rL   Ú
errorTypesÚerrors      r   ÚtrapÚFailure.trap•  s&   € ð0 —
’
˜JÐ'ˆÞØ×ÑÔ!Øˆr   c                óÌ   • U H^  nUn[         R                  " U5      (       a+  [        U[        5      (       a  [        R
                  " U5      nX0R                  ;   d  M\  Us  $    g)zÛ
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)r¨   r©   rª   rŽ   r   r¬   r®   )rL   r½   r¾   Úerrs       r   r»   ÚFailure.check²  sP   € ó  ˆEØˆCÜ�Š˜u×%Ñ%¬*°U¼I×*FÑ*FÜ—l’l 5Ó)�Ø—l‘lÕ"Ø’ñ  ð r   c                óL   • U R                   R                  U R                  5      e)zN
raise the original exception, preserving traceback
information if available.
)r‰   Úwith_tracebackrA   ry   s    r   r¼   ÚFailure.raiseExceptionÂ  s   € ð
 �j‰j×'Ñ'¨¯©Ó0Ð0r   c                ój   • UR                  U R                  R                  U R                  5      5      $ )a  
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.
)Úthrowr‰   rÅ   rA   )rL   Úgs     r   ÚthrowExceptionIntoGeneratorÚ#Failure.throwExceptionIntoGeneratorÉ  s&   € ð �w‰w�t—z‘z×0Ñ0°·±Ó9Ó:Ð:r   c                ó¼   • SR                  [        R                  " U R                  5      [        R                  " U R                  5      U R                  5       5      $ )Nz<{} {}: {}>)Úformatr   r¬   r�   rˆ   ÚgetErrorMessagery   s    r   Ú__repr__ÚFailure.__repr__Õ  sA   € Ø×#Ñ#Ü�LŠL˜Ÿ™Ó(Ü�LŠL˜Ÿ™Ó#Ø× Ñ Ó"ó
ð 	
r   c                ó(   • SU R                  5       -  $ )Nz[Failure instance: %s])ÚgetBriefTracebackry   s    r   Ú__str__ÚFailure.__str__Ü  s   € Ø'¨$×*@Ñ*@Ó*BÑBÐBr   c                ó¸   • SU;   a  UR                  S5        UR                  S5      US'   UR                  S5      US'   U R                  R                  U5        g )Nr?   r®   r§   r(   r—   )Úpopr²   Úupdate©rL   Ústates     r   Ú__setstate__ÚFailure.__setstate__ß  sN   € Ø�eÓØ�I‰I�gÔØ!ŸI™I iÓ0ˆˆjÑØ Ÿ9™9 XÓ.ˆˆiÑØ�‰×Ñ˜UÕ#r   c                óž  • U R                   nU R                  R                  5       nUR                  S5      US'   / US'   SU;   a  UR                  S5        U R                  (       aG  U R
                   Vs/ s H+  nUS   US   US   [        US   5      [        US	   5      /PM-     snUS
'   OU R
                  US
'   SUS'   SUS'   U$ s  snf )zÃ
Avoid pickling objects in the traceback.

This is not called direclty by pickle, since C{BaseException}
implements reduce; instead, pickle calls C{Failure.__reduce__} which
then calls this API.
r§   r®   r?   r—   r   r9   é   é   r   r(   NrA   Úpickled)r®   r²   r\   rÖ   rŠ   r(   Ú_safeReprVars)rL   Ú_ÚcÚvs       r   Ú__getstate__ÚFailure.__getstate__æ  sß   € ð �L‰Lˆà�M‰M×ÑÓ ˆð —u‘u˜ZÓ(ˆˆ)‰Øˆˆ'‰
à˜‹>Ø�E‰E�)Ôà××ð Ÿšó	ò %�Að �a‘DØ�a‘DØ�a‘DÜ! ! A¡$Ó'Ü! ! A¡$Ó'óñ %ñ	ˆAˆhŠKð Ÿ+™+ˆAˆh‰Kð ˆˆ$‰àˆˆ)‰Øˆùò#	s   Á62C
c                ó`   • [        [        R                  [        5      SU R                  5       4$ )Nr   )r   rƒ   r¶   rä   ry   s    r   Ú
__reduce__ÚFailure.__reduce__  s%   € ô œŸ™¬Ó1°2°t×7HÑ7HÓ7JÐKÐKr   c                ó´   • U R                  5       nUR                  S5      US'   Xl        [        U R                  SS5      (       a  SU R                  l        gg)z¨
Remove references to other objects, replacing them with strings.

On Python 3, this will also set the C{__traceback__} attribute of the
exception instance to L{None}.
r(   r—   r†   N)rä   rÖ   r²   r‘   r‰   r†   rØ   s     r   ÚcleanFailureÚFailure.cleanFailure  sN   € ð ×!Ñ!Ó#ˆØ Ÿ9™9 XÓ.ˆˆiÑØŒÜ�4—:‘:˜°×5Ñ5à'+ˆD�J‰JÕ$ð 6r   c                ó’   • U R                   b  U R                   $ [        U R                  5      S:”  a  [        U R                  5      $ g)aY  
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.
Nr   )rA   r:   r(   rC   ry   s    r   ÚgetTracebackObjectÚFailure.getTracebackObject!  s:   € ð �7‰7ÑØ—7‘7ˆNÜ�—‘Ó Ó!Ü˜dŸk™kÓ*Ð*àr   c                ó´   • [        U R                  [        5      (       a  U R                  R                  5       $ [        R
                  " U R                  5      $ )z:
Get a string of the exception which caused this Failure.
)r�   r‰   rƒ   rÎ   r   Úsafe_strry   s    r   rÎ   ÚFailure.getErrorMessage2  s=   € ô �d—j‘j¤'×*Ñ*Ø—:‘:×-Ñ-Ó/Ð/Ü×Ò §
¡
Ó+Ð+r   c                óT   • [        5       nU R                  US9  UR                  5       $ )N)Úfile)r   ÚprintBriefTracebackÚgetvalue)rL   Úios     r   rÒ   ÚFailure.getBriefTraceback:  s&   € Ü‹ZˆØ× Ñ  bÐ Ñ)Ø�{‰{‹}Ðr   c                óV   • [        5       nU R                  X1US9  UR                  5       $ )N)ró   ÚelideFrameworkCoder*   )r   ÚprintTracebackrõ   )rL   rù   r*   rö   s       r   ÚgetTracebackÚFailure.getTraceback?  s/   € Ü‹ZˆØ×ÑØÀ6ð 	ñ 	
ð �{‰{‹}Ðr   c           	     ó¸  • Uc  SSK Jn  UR                  nUR                  nUS:X  a  U R                  (       d  SnOUnUS:X  a4  U" SU R
                  U R                  =(       a    S=(       d    S4-  5        OuUS	:X  ag  U R                  (       a  S
nOSnU" U< S[        R                  " U R                  5      < S[        R                  " U R                  5      < S35        OU" S5        U R                  (       a  [        U R                  XV5        OUS	:X  d  U" S5        US	:X  dJ  U" [        R                  " U R                  5       S[        R                  " U R                  5       S35        [        U R                  [        5      (       a-  UR                  S5        U R                  R!                  XU5        US:X  a  U" SU R
                  -  5        gg)aT  
Emulate Python's standard error reporting mechanism.

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

@param elideFrameworkCode: Deprecated, ignored.

@param detail: A string indicating how much information to include
    in the traceback.  Must be one of C{'brief'}, C{'default'}, or
    C{'verbose'}.
Nr   )Úlogr   r   z*--- Failure #%d%s---
z (pickled) Ú r   Ú	Tracebackz"Traceback (failure with no frames)z: r"   z#Traceback (most recent call last):
z	Failure: z (chained Failure)
z*--- End of Failure #%d ---
)Útwisted.pythonrþ   Úlogerrr)   rŠ   r‡   rß   r(   r   rð   rˆ   r‰   r3   r¬   r�   rƒ   rú   )rL   ró   rù   r*   rþ   r+   ÚformatDetailÚ	hasFramess           r   rú   ÚFailure.printTracebackF  s~  € ð ‰<Ý*à—:‘:ˆDà�J‰Jˆà�YÓ t×'7×'7ð 7‰Là!ˆLð �YÓÙØ)Ø—:‘: §¡× >°×FÀ3ÐGñHõð �wÓØ�{�{Ø'‘	à@�	Ùãœg×.Ò.¨t¯y©yÖ9¼7×;KÒ;KÈDÏJÉJÖ;WðYõñ
 Ð4Ô5ð �;�;Ü˜$Ÿ+™+ qÕ7Ø˜7Ó"áˆkŒNð ˜Ó Ù”—’˜dŸi™iÓ(Ð)¨¬G×,<Ò,<¸T¿Z¹ZÓ,HÐ+IÈÐLÔMô �d—j‘j¤'×*Ñ*à�J‰JÐ-Ô.Ø�J‰J×%Ñ% dÀÔGØ�YÓÙÐ-°·
±
Ñ:Õ;ð r   c                ó$   • U R                  XSS9  g)z+
Print a traceback as densely as possible.
r   ©r*   N©rú   ©rL   ró   rù   s      r   rô   ÚFailure.printBriefTraceback‡  s   € ð 	×Ñ˜D¸WÐÒEr   c                ó$   • U R                  XSS9  g)zA
Print a traceback with detailed locals and globals information.
r   r  Nr  r	  s      r   ÚprintDetailedTracebackÚFailure.printDetailedTraceback�  s   € ð 	×Ñ˜D¸YÐÒGr   )r²   r—   r§   rŠ   r‡   rA   rˆ   r‰   )NNNF)r‰   ÚBaseExceptionÚreturnrƒ   )r  r   )r  Ústr)r   r   )rù   Úintr*   r  r  r  )NFr   )Nr   )%r   r   r   r   r7   rß   r§   rN   Úpropertyr(   Úsetterr   r
   r?   r®   r�   Ústaticmethodr¸   r¿   r»   r¼   r�   rÊ   rÏ   rÓ   rÚ   rä   rç   rê   rí   rÎ   rÒ   rû   rú   rô   r  r   r   r   r   rƒ   rƒ   á   s1  † ñð4 €GØ€Hô7ðr ñ ó ð ðD ‡]�]ñó ðñ ™ 	¨2¨r°1Ó5Ó6ñó 7ðð ‡\�\ñó ðð ñ	ó ð	ð ‡^�^ñ ó ð ò
9ð óó ðò"ò:ô 1ð ñ	;ó ð	;ô
ôCò$ò&òPLò
,òô",ôö
ô?<ôBF÷Hr   rƒ   c                óh   • U  VVs/ s H  u  pU[         R                  " U5      4PM     snn$ s  snnf )aU  
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.
)r   Ú	safe_repr)ÚvarsDictItemsr1   Úobjs      r   rà   rà   ”  s/   € ñ ?LÔLºm©{°ˆT”7×$Ò$ SÓ)Ó*¹mÒLÐLùÓLs   †$.TFc                ó4  • XU4S:X  at  [         R                  " 5       nUS   U R                  :X  dL  [        (       aA   [	        US   5      n[        SR                  U5      5        SSKnUR                  US   5        U" XX#U5        g! [
         a    Sn NKf = f)z3
Initialize failure object, possibly spawning pdb.
)NNNr   r9   z
broken strz8Jumping into debugger for post-mortem of exception '{}':NrÝ   )
r‹   rŒ   r�   ÚDO_POST_MORTEMr  r  ÚprintrÍ   ÚpdbÚpost_mortem)	rL   r’   r“   r”   rŠ   ÚFailure__init__ÚexcÚstrreprr  s	            r   Ú
_debuginitr!  §  s•   € ð 	˜VÐ$Ð(:Ó:Ü�lŠl‹nˆØ�1‰v˜Ÿ™Ó'¯NªNð'Ü˜c !™f›+�ô ØJ×QÑQØóôó
 à�O‰O˜C ™FÔ#Ù�D X°{ÕCøô !ó 'Ø&’ð'ús   ½B ÂBÂBc                 ó"   • [         [        l        g)z"
Enable debug hooks for Failures.
N)r!  rƒ   rN   r   r   r   ÚstartDebugModer#  Ä  s   € ô "„GÕr   )r   )r€   r   r  r   )-r7   Ú
__future__r   r[   r\   r¨   r$   r‹   Ú	functoolsr   r   rö   r   Útypingr   r   r	   Úincrementalr
   r  r   Útwisted.python.deprecater   Úobjectr   r‡   ÚtraceupLengthrŽ   r   r3   ÚEXCEPTION_CAUGHT_HEREr5   rC   r<   r;   rT   r}   r�   r  rƒ   rà   r  rN   r!  r#  r   r   r   Ú<module>r,     sî   ðñõ #ó Û Û Û Û 
Ý Ý Ý ß .Ñ .å å "Ý 7á�m¨8°C¸°KÑ+@ÑA€à	€Ø€ô	�yô 	ô+/ð^ :Ð ô˜iô ò÷Bñ ÷ ñ ÷8+ñ +ð<  Ð ôô pHˆmô pHòfMð  €ð
 ØØØØ×$Ñ$ôDó:"r   