Ńň žňœMc@s dZddkZddkZddkZddklZdefd„ƒYZdefd„ƒYZd„Z d efd „ƒYZ d efd „ƒYZ d efd„ƒYZ defd„ƒYZ de fd„ƒYZdefd„ƒYZdd„Zd„ZdS(sexception classesi˙˙˙˙N(tutilt MakoExceptioncBseZRS((t__name__t __module__(((s5/usr/lib/python2.6/vendor-packages/mako/exceptions.pyR stRuntimeExceptioncBseZRS((RR(((s5/usr/lib/python2.6/vendor-packages/mako/exceptions.pyRscCs1|djod||fSd|||fSdS(Ns at line: %d char: %ds" in file '%s' at line: %d char: %d(tNone(tlinenotpostfilename((s5/usr/lib/python2.6/vendor-packages/mako/exceptions.pyt_format_fileposs tCompileExceptioncBseZd„ZRS(cCsHti||t|||ƒƒ||_||_||_||_dS(N(Rt__init__R RRRtsource(tselftmessageR RRR((s5/usr/lib/python2.6/vendor-packages/mako/exceptions.pyR s     (RRR (((s5/usr/lib/python2.6/vendor-packages/mako/exceptions.pyR stSyntaxExceptioncBseZd„ZRS(cCsHti||t|||ƒƒ||_||_||_||_dS(N(RR R RRRR (R RR RRR((s5/usr/lib/python2.6/vendor-packages/mako/exceptions.pyR "s     (RRR (((s5/usr/lib/python2.6/vendor-packages/mako/exceptions.pyR!stUnsupportedErrorcBseZdZRS(s&raised when a retired feature is used.(RRt__doc__(((s5/usr/lib/python2.6/vendor-packages/mako/exceptions.pyR)stTemplateLookupExceptioncBseZRS((RR(((s5/usr/lib/python2.6/vendor-packages/mako/exceptions.pyR,stTopLevelLookupExceptioncBseZRS((RR(((s5/usr/lib/python2.6/vendor-packages/mako/exceptions.pyR/st RichTracebackcBsteZdZd d d„Zed„ƒZd„Zd„Zed„ƒZ ed„ƒZ ed„ƒZ d„Z RS( sŞPulls the current exception from the sys traceback and extracts Mako-specific template information. See the usage examples in :ref:`handling_exceptions`. cCsód\|_|_|djp |djotiƒ\}}}n|djo|p|}n|djo |}n||_|i|ƒ|_t|it t fƒo7ddk }|ii|_|ii|_t |_ n|iƒdS(Ntii˙˙˙˙(Ri(R RRtsystexc_infoterrort_inittrecordst isinstanceR Rt mako.templatetTruet _has_sourcet _init_message(R Rt tracebacktttvaluettbacktmako((s5/usr/lib/python2.6/vendor-packages/mako/exceptions.pyR 9s      cCsti|iƒS(N(Rtexception_nameR(R ((s5/usr/lib/python2.6/vendor-packages/mako/exceptions.pyt errornamePscCsžyt|iƒ|_WnRtj oFyt|iƒ|_Wqktj o|iid|_qkXnXt|itƒpt|iddƒ|_ndS(s+Find a unicode representation of self.erroritasciitreplaceN(tunicodeRRt UnicodeErrortstrtUnicodeEncodeErrortargsR(R ((s5/usr/lib/python2.6/vendor-packages/mako/exceptions.pyRTsccs]xV|D]N}|ddj o%|d|d|d|dfVqt|dd!ƒVqWdS(Niiiii(Rttuple(R Rtrec((s5/usr/lib/python2.6/vendor-packages/mako/exceptions.pyt_get_reformatted_recordsbs %cCst|i|iƒƒS(sŠreturn a list of 4-tuple traceback records (i.e. normal python format) with template-corresponding lines remapped to the originating template. (tlistR0R(R ((s5/usr/lib/python2.6/vendor-packages/mako/exceptions.pyR iscCs t|iƒS(N(treversedR(R ((s5/usr/lib/python2.6/vendor-packages/mako/exceptions.pytreverse_recordsrscCst|i|iƒƒS(sDreturn the same data as traceback, except in reverse order. (R1R0R3(R ((s5/usr/lib/python2.6/vendor-packages/mako/exceptions.pytreverse_tracebackvscCs•ddk}h}ti|ƒ}g}xQ|D]I\}}}} | p d} ny||\} } Wnľtj oŠy8|ii|ƒ} | i} | i}| ip|}Wn˝tj oąt i pxy,t |dƒ}t i |ƒ}|i ƒWntj o d}nX|o| i|ƒ} qA| iddƒ} n|i|||| ddddfƒq.nXd}}h} x]| idƒD]L} tid | ƒ}|ot|idƒƒ}n|d7}|| | <%! from mako.exceptions import RichTraceback %>\ <% tback = RichTraceback(error=error, traceback=traceback) %>\ Traceback (most recent call last): % for (filename, lineno, function, line) in tback.traceback: File "${filename}", line ${lineno}, in ${function or '?'} ${line | trim} % endfor ${tback.errorname}: ${tback.message} (RR8tTemplate(tlookupR$((s5/usr/lib/python2.6/vendor-packages/mako/exceptions.pyttext_error_templateÎs  cCs.ddk}|iiddtiƒddƒS(sProvides a template that renders a stack trace in an HTML format, providing an excerpt of code as well as substituting source template filenames, line numbers and code for that of the originating source template, as applicable. The template's default encoding_errors value is 'htmlentityreplace'. the template has two options. With the full option disabled, only a section of an HTML document is returned. with the css option disabled, the default stylesheet won't be included. i˙˙˙˙NsQ <%! from mako.exceptions import RichTraceback %> <%page args="full=True, css=True, error=None, traceback=None"/> % if full: Mako Runtime Error % endif % if css: % endif % if full: % endif

Error !

<% tback = RichTraceback(error=error, traceback=traceback) src = tback.source line = tback.lineno if src: lines = src.split('\n') else: lines = None %>

${tback.errorname}: ${tback.message}

% if lines:
% for index in range(max(0, line-4),min(len(lines), line+5)): % if index + 1 == line:
${index + 1} ${lines[index] | h}
% else:
${index + 1} ${lines[index] | h}
% endif % endfor
% endif
% for (filename, lineno, function, line) in tback.reverse_traceback:
${filename}, line ${lineno}:
${line | h}
% endfor
% if full: % endif toutput_encodingtencoding_errorsthtmlentityreplace(RR8R_Rtgetdefaultencoding(R$((s5/usr/lib/python2.6/vendor-packages/mako/exceptions.pythtml_error_templatećs  @(RR RRDR$Rt ExceptionRRR R RRRRtobjectRRRaRf(((s5/usr/lib/python2.6/vendor-packages/mako/exceptions.pyts$ œ