%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/227033/root/opt/alt/python27/lib/python2.7/site-packages/mako/
Upload File :
Create Path :
Current File : //proc/227033/root/opt/alt/python27/lib/python2.7/site-packages/mako/exceptions.pyo

�
�ǚPc@sudZddlZddlZddlZddlmZdefd��YZdefd��YZd�Z	d	efd
��YZ
defd��YZd
efd��YZdefd��YZ
defd��YZdefd��YZdefd��YZdd�ZyddlmZmZWn6ek
rgddlmZdZddd�ZnXd�ZdS(sexception classesi����N(tutilt
MakoExceptioncBseZRS((t__name__t
__module__(((s@/opt/alt/python27/lib/python2.7/site-packages/mako/exceptions.pyRstRuntimeExceptioncBseZRS((RR(((s@/opt/alt/python27/lib/python2.7/site-packages/mako/exceptions.pyRscCs/|dkrd||fSd|||fSdS(Ns at line: %d char: %ds" in file '%s' at line: %d char: %d(tNone(tlinenotpostfilename((s@/opt/alt/python27/lib/python2.7/site-packages/mako/exceptions.pyt_format_fileposstCompileExceptioncBseZd�ZRS(cCsHtj||t|||��||_||_||_||_dS(N(Rt__init__R	RRRtsource(tselftmessageRRRR((s@/opt/alt/python27/lib/python2.7/site-packages/mako/exceptions.pyRs				(RRR(((s@/opt/alt/python27/lib/python2.7/site-packages/mako/exceptions.pyR
stSyntaxExceptioncBseZd�ZRS(cCsHtj||t|||��||_||_||_||_dS(N(RRR	RRRR(R
RRRRR((s@/opt/alt/python27/lib/python2.7/site-packages/mako/exceptions.pyR#s				(RRR(((s@/opt/alt/python27/lib/python2.7/site-packages/mako/exceptions.pyR"stUnsupportedErrorcBseZdZRS(s&raised when a retired feature is used.(RRt__doc__(((s@/opt/alt/python27/lib/python2.7/site-packages/mako/exceptions.pyR+stNameConflictErrorcBseZdZRS(s3raised when a reserved word is used inappropriately(RRR(((s@/opt/alt/python27/lib/python2.7/site-packages/mako/exceptions.pyR.stTemplateLookupExceptioncBseZRS((RR(((s@/opt/alt/python27/lib/python2.7/site-packages/mako/exceptions.pyR1stTopLevelLookupExceptioncBseZRS((RR(((s@/opt/alt/python27/lib/python2.7/site-packages/mako/exceptions.pyR4st
RichTracebackcBsteZdZd	d	d�Zed��Zd�Zd�Zed��Z	ed��Z
ed��Zd�ZRS(
s�Pull the current exception from the ``sys`` traceback and extracts
    Mako-specific template information.

    See the usage examples in :ref:`handling_exceptions`.

    cCs�d\|_|_|dks*|dkrBtj�\}}}n|dkr]|pW|}n|dkrr|}n||_|j|�|_t|jt	t
f�r�ddl}|jj|_|jj|_t|_
n|j�dS(Ntii����(Ri(RRRtsystexc_infoterrort_inittrecordst
isinstanceR
Rt
mako.templatetTruet_has_sourcet
_init_message(R
Rt	tracebacktttvaluettbacktmako((s@/opt/alt/python27/lib/python2.7/site-packages/mako/exceptions.pyR>s		cCstj|j�S(N(Rtexception_nameR(R
((s@/opt/alt/python27/lib/python2.7/site-packages/mako/exceptions.pyt	errornameUscCs�yt|j�|_WnNtk
rfyt|j�|_Wqgtk
rb|jjd|_qgXnXt|jt�s�t|jdd�|_ndS(s+Find a unicode representation of self.erroritasciitreplaceN(tunicodeRRtUnicodeErrortstrtUnicodeEncodeErrortargsR(R
((s@/opt/alt/python27/lib/python2.7/site-packages/mako/exceptions.pyR Ys

ccs[xT|D]L}|ddk	rA|d|d|d|dfVqt|dd!�VqWdS(Niiiii(Rttuple(R
Rtrec((s@/opt/alt/python27/lib/python2.7/site-packages/mako/exceptions.pyt_get_reformatted_recordsgs
$cCst|j|j��S(s�Return a list of 4-tuple traceback records (i.e. normal python
        format) with template-corresponding lines remapped to the originating
        template.

        (tlistR1R(R
((s@/opt/alt/python27/lib/python2.7/site-packages/mako/exceptions.pyR!nscCs
t|j�S(N(treversedR(R
((s@/opt/alt/python27/lib/python2.7/site-packages/mako/exceptions.pytreverse_recordswscCst|j|j��S(sDReturn the same data as traceback, except in reverse order.
        (R2R1R4(R
((s@/opt/alt/python27/lib/python2.7/site-packages/mako/exceptions.pytreverse_traceback{scCsrddl}i}tj|�}g}x8|D]0\}}}}	|	sOd}	ny||\}
}Wn�tk
ry7|jj|�}|j}
|j}|jp�|}Wn�tk
rat	j
s6y,t|d�}t	j|�}|j
�Wntk
rd}nX|r!|	j|�}	q6|	jdd�}	n|j||||	ddddf�q.nXd}}i}
x[|
jd�D]J}	tjd	|	�}|r�t|jd��}n|d7}||
|<q�Wg|jd�D]}	|	^q�}|
|f||<nX|
|}|t|�kr3||d}nd}|j||||	||||f�q.W|jsnxtt|�dd
d�D]:}||dr�||d|_||d|_Pq�q�W|rnynt|dd
d�}t	j|�}|jd
�|j�|_|j
�|r9|jj|�|_nWntk
rVd|_nX|dd|_qnn|S(
sformat a traceback from sys.exc_info() into 7-item tuples,
        containing the regular four traceback tuple items, plus the original
        template filename, the line number adjusted relative to the template
        source, and code line from that line number of the template.i����NRtrbR(R)is
s\s*# SOURCE LINE (\d+)iii(RR!t
extract_tbtKeyErrorttemplatet_get_module_infotcodeRttemplate_filenameRtpy3ktopentparse_encodingtclosetIOErrorRtdecodetappendtsplittretmatchtinttgrouptlentrangeRtseektread(R
ttrcbackR%tmodst
rawrecordstnew_trcbackRRtfunctiontlinetline_mapttemplate_linestinfot
module_sourcettemplate_sourceR<tfptencodingttemplate_lnt	module_lnRFt
template_linetl((s@/opt/alt/python27/lib/python2.7/site-packages/mako/exceptions.pyR�s�	
		
	




		#



N(
RRRRRtpropertyR'R R1R!R4R5R(((s@/opt/alt/python27/lib/python2.7/site-packages/mako/exceptions.pyR7s			cCsddl}|jjd�S(s�Provides a template that renders a stack trace in a similar format to
    the Python interpreter, substituting source template filenames, line
    numbers and code for that of the originating source template, as
    applicable.

    i����Ns�
<%page args="error=None, traceback=None"/>
<%!
    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}
(RR9tTemplate(tlookupR%((s@/opt/alt/python27/lib/python2.7/site-packages/mako/exceptions.pyttext_error_template�s	(tsyntax_highlighttpygments_html_formatter(thtml_escapeRcCstS(N(Rd(Rtlanguage((s@/opt/alt/python27/lib/python2.7/site-packages/mako/exceptions.pyRb�scCs.ddl}|jjddtj�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����Ns�
<%!
    from mako.exceptions import RichTraceback, syntax_highlight,\
            pygments_html_formatter
%>
<%page args="full=True, css=True, error=None, traceback=None"/>
% if full:
<html>
<head>
    <title>Mako Runtime Error</title>
% endif
% if css:
    <style>
        body { font-family:verdana; margin:10px 30px 10px 30px;}
        .stacktrace { margin:5px 5px 5px 5px; }
        .highlight { padding:0px 10px 0px 10px; background-color:#9F9FDF; }
        .nonhighlight { padding:0px; background-color:#DFDFDF; }
        .sample { padding:10px; margin:10px 10px 10px 10px;
                  font-family:monospace; }
        .sampleline { padding:0px 10px 0px 10px; }
        .sourceline { margin:5px 5px 10px 5px; font-family:monospace;}
        .location { font-size:80%; }
        .highlight { white-space:pre; }
        .sampleline { white-space:pre; }

    % if pygments_html_formatter:
        ${pygments_html_formatter.get_style_defs()}
        .linenos { min-width: 2.5em; text-align: right; }
        pre { margin: 0; }
        .syntax-highlighted { padding: 0 10px; }
        .syntax-highlightedtable { border-spacing: 1px; }
        .nonhighlight { border-top: 1px solid #DFDFDF;
                        border-bottom: 1px solid #DFDFDF; }
        .stacktrace .nonhighlight { margin: 5px 15px 10px; }
        .sourceline { margin: 0 0; font-family:monospace; }
        .code { background-color: #F8F8F8; width: 100%; }
        .error .code { background-color: #FFBDBD; }
        .error .syntax-highlighted { background-color: #FFBDBD; }
    % endif

    </style>
% endif
% if full:
</head>
<body>
% endif

<h2>Error !</h2>
<%
    tback = RichTraceback(error=error, traceback=traceback)
    src = tback.source
    line = tback.lineno
    if src:
        lines = src.split('\n')
    else:
        lines = None
%>
<h3>${tback.errorname}: ${tback.message|h}</h3>

% if lines:
    <div class="sample">
    <div class="nonhighlight">
% for index in range(max(0, line-4),min(len(lines), line+5)):
    <%
       if pygments_html_formatter:
           pygments_html_formatter.linenostart = index + 1
    %>
    % if index + 1 == line:
    <%
       if pygments_html_formatter:
           old_cssclass = pygments_html_formatter.cssclass
           pygments_html_formatter.cssclass = 'error ' + old_cssclass
    %>
        ${lines[index] | syntax_highlight(language='mako')}
    <%
       if pygments_html_formatter:
           pygments_html_formatter.cssclass = old_cssclass
    %>
    % else:
        ${lines[index] | syntax_highlight(language='mako')}
    % endif
% endfor
    </div>
    </div>
% endif

<div class="stacktrace">
% for (filename, lineno, function, line) in tback.reverse_traceback:
    <div class="location">${filename}, line ${lineno}:</div>
    <div class="nonhighlight">
    <%
       if pygments_html_formatter:
           pygments_html_formatter.linenostart = lineno
    %>
      <div class="sourceline">${line | syntax_highlight(filename)}</div>
    </div>
% endfor
</div>

% if full:
</body>
</html>
% endif
toutput_encodingtencoding_errorsthtmlentityreplace(RR9R_Rtgetdefaultencoding(R%((s@/opt/alt/python27/lib/python2.7/site-packages/mako/exceptions.pythtml_error_template�s	g(RR!RRER%Rt	ExceptionRRR	R
RRRRRtobjectRRRatmako.ext.pygmentpluginRbRctImportErrortmako.filtersRdRj(((s@/opt/alt/python27/lib/python2.7/site-packages/mako/exceptions.pyt<module>s($			�


Zerion Mini Shell 1.0