mò /á¸Ec@sždZdkZdkZdZdfd„ƒYZdefd„ƒYZdZeedƒoeeei ƒZneeƒZ eeƒZ dd d „Z dS( s¥An exception formatter that shows traceback supplements and traceback info, optionally in HTML. $Id: ExceptionFormatter.py 40218 2005-11-18 14:39:19Z andreasjung $ NitTextExceptionFormattercBs¡tZdZdZdd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „Zd„Zd„Zd„Zdd„ZRS(Ns icCs ||_dS(N(tlimittself(RR((t=/data/zmath/zope/lib/python/zExceptions/ExceptionFormatter.pyt__init__ scCs|S(N(ts(RR((Rtescape#scCsdS(NsTraceback (innermost last):((R((Rt getPrefix&scCs0|i}|djottddƒ}n|S(Nttracebacklimit(RRtNonetgetattrtsys(RR((RtgetLimit)s  cCs‚|ipdSn|iddƒ}|djo|iddƒ}n|dj o*yt|ƒiƒ}Wq~d}q~Xn|S(Nt __revision__t __version__s???(Rtshow_revisionsR tglobalstgettrevisiontstrtstrip(RRR((Rt getRevision/s   cCsd|S(Ns - %s(tline(RR((RtformatSupplementLine>scCs|it|ƒƒgS(N(RRtreprtobject(RR((Rt formatObjectAscCs|id|ƒgS(NsURL: %s(RRturl(RR((RtformatSourceURLDsc Csõg}|i} t|ddƒ}|dj o|i|i |ƒƒnt|ddƒ}|dj o|i|i |ƒƒnt|ddƒ} | djo |i} nt|ddƒ} | oV| dj o.| djo!|i| d| | fƒƒqQ|i| d| ƒƒn6| dj o(| djo|i| d | ƒƒnt|d dƒ} | o|i| d | ƒƒnt|d dƒ}|o,x)|D]}|i| d |ƒƒq¥Wn|i|ƒ}|o|i|ƒn|S(NRt source_urlRiiÿÿÿÿtcolumnsLine %s, Column %ssLine %ss Column %st expressionsExpression: %stwarningss Warning: %s(tresultRRtfmtLineR t supplementR RtextendRRRRttbt tb_linenotcoltappendtexprR twarningtformatExtraInfotextra( RR#R%R,R*R RRR!R)RR"R'((RtformatSupplementGs<     !cCs?t|ddƒ}|dj o|ƒ}|o|Sq;ndS(NtgetInfo(R R#R R.R,(RR#R,R.((RR+ns    cCs|id|fƒS(Ns__traceback_info__: %s(RRttbi(RR/((RtformatTracebackInfovscCsÂ|i}|i}|i}|i} |i }|i }|i }|id| ƒ}d||f} |i|ƒ}|o| d|} n| d|} g}|i|i| ƒƒ|idƒo|d}n%|idƒo|d}nd}|dj oi|d}|d} y)|| Œ}|i|i||ƒƒWqkt odk!} | i"ƒqgqkXny=|iddƒ} | dj o|i|i$| ƒƒnWnnX|i%i&|ƒS( Nt__name__s Module %s, line %ds , rev. %ss, in %st__traceback_supplement__iit__traceback_info__('R%ttb_frametfR&tlinenotf_codetcot co_filenametfilenametco_nametnametf_localstlocalst f_globalsRRtmodnameRRRRR!R(Rthas_keyttbsR tfactorytargstsuppR$R-tDEBUG_EXCEPTION_FORMATTERt tracebackt print_excR/R0tline_septjoin(RR%R!RCR@R8R<R5RERDRGR:R/RRR6RBR>R((Rt formatLineysJ             cCs%dk}|ii|i||ƒƒS(N(RGRRIRJtformat_exception_onlytetypetvalue(RRMRNRG((RtformatExceptionOnly­s cCs |i|ƒS(N(RRtexc_line(RRP((RtformatLastLine²sc Csòd}|iƒdg}|djo|iƒ}nd}x‡|dj oy|djp ||jo_|i i i dƒo|i dƒPn|i |ƒ}|i |dƒ|i}|d}q?W|i||ƒ} |i |i| ƒƒ|S(Nis it__exception_formatter__s&(Recursive formatException() stopped) (RRRRR!RR R tnR%R4R=RR(RKRttb_nextRORMRNRPRQ( RRMRNR%RRSRRR!RRP((RtformatExceptionµs" '  (R1t __module__RIRR RRRR RRRRR-R+R0RKRORQRU(((RRs"         '   4  tHTMLExceptionFormattercBsMtZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z RS( Ns
cCs ti|ƒS(N(tcgiRR(RR((RRÏscCsdS(Ns$

Traceback (innermost last):

%s

(RRRP(RRP((RRQáscCsBt|ddƒ}|dj o|dƒ}|o|Sq>ndS(NR.i(R R#R R.R,(RR#R,R.((RR+äs    ( R1RVRIRRRR0RKRQR+(((RRWËs      iÈRicCs0|o t}nt}|i|||d|ƒS(NR( tas_htmlthtml_formattertfmtttext_formatterRUtttvR%R(R^R_R%RRZR\((Rtformat_exception÷s (t__doc__R RXRFRRWRthasattrtminRR]R[R R`( RXRRFRWR`R RR]R[((Rt?s  °#