ó
¹XˆUc@sdZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl
Z
ddlZd„ZgZ
d„Zd„Zd„Zd„Zd„Zd d
„Zd d„Zddd
„ƒYZeƒjZddd dd„ZdS(sšMore comprehensive traceback formatting for Python scripts.
To enable this module, do:
import cgitb; cgitb.enable()
at the top of your script. The optional arguments to enable() are:
display - if true, tracebacks are displayed in the web browser
logdir - if set, tracebacks are written to files in this directory
context - number of lines of source code to show for each stack frame
format - 'text' or 'html' controls the output format
By default, tracebacks are displayed but not saved, the context is 5 lines
and the output format is 'html' (for backwards compatibility with the
original use of this module)
Alternatively, if you have caught an exception and want cgitb to display it
for you, call cgitb.handler(). The optional argument to handler() is a
3-item tuple (etype, evalue, etb) just like the value of sys.exc_info().
The default handler displays output as HTML.
iÿÿÿÿNcCsdS(sAReturn a string that resets the CGI and browser to a known state.s'
--> -->
((((sE/src/external-vcs/github/rocky/python-uncompyle6/test/ok_2.7/cgitb.pytreset$scCs|rd|dSdSdS(Nsst((ttext((sE/src/external-vcs/github/rocky/python-uncompyle6/test/ok_2.7/cgitb.pytsmall/scCs|rd|dSdSdS(Nss R((R((sE/src/external-vcs/github/rocky/python-uncompyle6/test/ok_2.7/cgitb.pytstrong5scCs|rd|dSdSdS(NssR((R((sE/src/external-vcs/github/rocky/python-uncompyle6/test/ok_2.7/cgitb.pytgrey;scCsº||krd||fS||jkr:d|j|fSd|jkr°|jd}t|ƒtiƒkr‹||krd||fSq°t||ƒr°dt||ƒfSndtfS(s9Find the value for a given name in the given environment.tlocaltglobalt__builtins__tbuiltinN(t f_globalsttypethasattrtgetattrtNonet __UNDEF__(tnametframetlocalstbuiltins((sE/src/external-vcs/github/rocky/python-uncompyle6/test/ok_2.7/cgitb.pytlookupAs
cCs2gdddtf\}}}}}xtj|ƒD]ö\}} }
}}|tjkr\Pn|tjkrõ| tjkrõ|dkrÄ|tk ròt|| tƒ}|j || ||fƒqòq$t
| ||ƒ\}
}|j | |
|fƒn/| dkr||d7}|}nd\}}| }q4W|S(sEScan one logical line of Python and look up values of variables used.Rt.N(NR(RRttokenizetgenerate_tokenstNEWLINEtNAMEtkeywordtkwlistR
tappendR(treaderRRtvarst lasttokentparenttprefixtvaluetttypettokentstarttendtlinetwhere((sE/src/external-vcs/github/rocky/python-uncompyle6/test/ok_2.7/cgitb.pytscanvarsQs"$%
ic" sÔ|\}}}t|ƒtjkr0|j}ndtjjƒddtj}tj tjƒƒ}dt
jjdt
t
jjt|ƒƒƒdd|d|ƒd }d
tddƒd
}g} tj||ƒ}
xø|
D]ð\}‰}}
}}ˆr4tjjˆƒ‰dˆt
jjˆƒf}n
d‰}tj|ƒ\}}}}d}|
dkrdt
|
ƒtj||||dd„ƒ}ni‰|g‡‡fd†}t|||ƒ}dd||fg}|d+k r´||}x¸|D]}tddtt|ƒƒt|ƒƒd}|ˆkrpd|t
jj|ƒf}|jd|ƒn3d|t
jj|ƒf}|jdt|ƒƒ|d7}qWnig}}xÑ|D]É\}}} ||kréqÈnd||<| tk r€|d,kr"d|t
|ƒ}n8|dkr=t
|ƒ}n|t
|jd ƒd!ƒ}|jd"|t
jj| ƒfƒqÈ|j|d#ƒqÈW|jdttd$j |ƒƒƒƒ| jd%d&j |ƒƒqåWd't
t
jjt|ƒƒƒt
jjt|ƒƒfg}!t!|t"ƒrŠxbt#|ƒD]Q}|d d(krNq2nt
jjt$||ƒƒ} |!jd)||| fƒq2Wn|dj | ƒdj |!ƒd*t
jjdj t%j&|||ƒƒƒS(-s9Return a nice HTML document describing a given traceback.sPython is: ss%ss#ffffffs#6622aas
s‹
A problem occurred in a Python script. Here is the sequence of
function calls leading up to the error, in the order they occurred.
ss is s%st?Rsin tformatvaluecSsdtjj|ƒS(Nt=(tpydocthtmltrepr(R"((sE/src/external-vcs/github/rocky/python-uncompyle6/test/ok_2.7/cgitb.pyt‚scs>dˆ|d