%PDF- %PDF-
Mini Shell

Mini Shell

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

�
a�Nc@sdZddlZddlZddlmZd�Zdefd��YZdefd��YZd	efd
��YZ	dZ
dZed
�Z
d�Zejd�Zejd�Zejd�Zeded�Zeded�Zdd�Zddd�Zddd�ZdS(sG
Formatters for the exception data that comes from ExceptionCollector.
i����N(t
PySourceColorcCstjt|�t�S(N(tcgitescapetstrtTrue(ts((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyt
html_quotestAbstractFormattercBsMeZddgZeeedd�Zd�Zd�Zd�Zd�Z	RS(tobjectt
source_urlcCs(||_||_||_||_dS(N(tshow_hidden_framesttrim_source_pathstinclude_reusabletshow_extra_data(tselfR
RR
R((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyt__init__s			cCs�i}|jr�x{|jj�D]g\}}t|t�rI|\}}n
d|}}x-|D]%}|j|||�|||f<q]WqWng}|j|j�}	x|	D]}
|
j}|r�|j	r�|j
|j	�|d
<n|jr|j|j�|d<n|j
r0|j|j|j
|j��n|jrU|j|j|j��n|jr�x*|jD]}|j|j|��qhWn|jr�|j|j|j��q�n|
jr�|jd�|j|j|
j��n|
jr
|j|j|
j��n|
j}
|
rf|jrfxA|jD]3\}}|
j|�r,||
t|�}
Pq,q,Wn|j|j |
p{d|
��|
j!�}|
j!d�}|r�|j|j"||��q�q�W|j#}t|t$�s�|j%}n|j&||j'�}igd6gd6gd6gd	6}x7|j�D])\\}}}||j||f�q.Wx|j(�D]}|j)�qhW|j*|||�S(Ntnormalt	importantRR	sException in supplement:t?itsupplementaltextra(Rsobject(Rs
source_url(+R
t
extra_datatitemst
isinstancettupletformat_extra_datat
filter_framestframest
supplementRtformat_sup_objectR	tformat_sup_urltlinetappendtformat_sup_line_postcolumnt
expressiontformat_sup_expressiontwarningstformat_sup_warningtinfotextendtformat_sup_infotsupplement_exceptiont
quote_longttraceback_infotformat_traceback_infotfilenameRt
startswithtlentformat_source_linetget_source_linetformat_long_sourcetexception_typet
basestringt__name__tformat_exception_infotexception_valuetvaluestsorttformat_combine(Rtexc_datatgeneral_datatnamet
value_listt
importancettitletvaluetlinesRtframetsuptwarningR.tpathtrepltsourcetlong_sourcetetypetexc_infotdata_by_importance((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pytformat_collected_datasx	

$
				"				
			
cCs|jr
|Sg}t}x�|D]�}|j}|dkrJg}t}n�|dkrhg}t}q nr|dkr}t}n]|dkr�t}q nE|dkr�t}n0|dkr�t}q n|r�q n|r�q n|j|�q W|d|kr�|S|S(s�
        Removes any frames that should be hidden, according to the
        values of traceback_hide, self.show_hidden_frames, and the
        hidden status of the final frame.
        tbeforetbefore_and_thistresettreset_and_thistaftertafter_and_thisi����(R
tFalsettraceback_hideRR (RRt
new_framesthiddenRDthide((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyR]s>	
				cCsad|krSt|�}|dd|dd!|dd}|jdd�}|St|�SdS(sa
        Formats the string as a triple-quoted string when it contains
        newlines.
        s
iiii����s\nN(treprtreplace(RR((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pytpretty_string_repr�s%cCsPd}xC|D];}tt|��dkr
|d7}|dkrHtSq
q
WtS(su
        Returns true if the list contains items that are long, and should
        be more nicely formatted.
        ii(ii(R0RZRRU(Rtlstthow_manytitem((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pytlong_item_list�s

((
R6t
__module__tgeneral_data_orderRURRRNRR\R`(((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyRs	?	,	
t
TextFormattercBs�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�ZRS(cCs|S(N((RR((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pytquote�scCs|S(N((RR((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyR+�scCs|S(N((RR((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyt	emphasize�scCs d|j|jt|���S(Ns
In object: %s(ReRdRZ(Rtobj((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyR�scCsd|j|�S(NsURL: %s(Rd(Rturl((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyR�scCs2|r|jd||f�S|jd|�SdS(NsLine %i, Column %isLine %i(Re(RRR"((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyR!�scCs|jd|j|��S(NsIn expression: %s(ReRd(Rtexpr((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyR$�scCsd|j|�S(NsWarning: %s(Rd(RRF((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyR&�scCs|j|�gS(N(R+(RR'((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyR)�scCs#d||jpd|jpdfS(NsFile %r, line %s in %sR(tlinenoR>(RR.RD((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyR1�scCs
|j|�S(N(t
format_source(RRIRJ((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyR3�scCsd|j|j��S(Ns  (Rdtstrip(Rtsource_line((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyRj�scCs)|jd|j|�|j|�f�S(Ns%s: %s(ReRd(RRKtevalue((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyR7�scCs|S(N((RR'((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyR-�scCs|g|dD]\}}|^q|d*|j|�x8dD]0}|jg||D]\}}|^qR�q;W|j|�S(NRiRRR(snormalssupplementalsextra(R R(tformat_combine_lines(RRMRCRLtnRBR>((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyR;�s
'

.cCs
dj|�S(Ns
(tjoin(RRC((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyRn�scCs|t|t�rI|j|�}d|kr8d||fSd||fSn/t|t�r�d|dt|�g}|j�}|j�xg|D]_\}}yt|�}Wntk
r�}	d|	}nXt	|�}|j
d||f�q�Wdj|�St|tt
f�r^|j|�r^g|D]}t	t|��^q)}
d|dj|
�fSd|t	t|��fSdS(	Ns
s%s:
%ss%s: %st-sCannot display: %ss  %s: %ss
%s: [
    %s]s,
    (RRR\tdictR0RR:RZt	ExceptionttruncateR RptlistRR`(RR@RARBRRCRRotvtetparts((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyR�s.

%(R6RaRdR+ReRRR!R$R&R)R1R3RjR7R-R;RnR(((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyRc�s"																t
HTMLFormattercBsweZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zdd�Z
RS(
cCs
t|�S(N(R(RR((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyRd�scCsd|j|�S(Ns
<pre>%s</pre>(Rd(RR((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyR+�scCsd|S(Ns	<b>%s</b>((RR((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyRe�scCsd||fS(NsURL: <a href="%s">%s</a>((RRg((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyR�scCs
dj|�S(Ns<br>
(Rp(RRC((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyRn�scCsR|j|jpd�}d||jp*d|jp6d|fSd||j|fS(NRsMModule <span class="module" title="%s">%s</span>:<b>%s</b> in <code>%s</code>sFile %r, line %s in <tt>%s</tt>(RdR>tmodnameRi(RR.RDR>((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyR1�scCs8t|tdt�}t|tdt�}d||fS(Niis><code style="display: none" class="source" source-type="long"><a class="switch_source" onclick="return switch_source(this, 'long')" href="#">&lt;&lt;&nbsp; </a>%s</code><code class="source" source-type="short"><a onclick="return switch_source(this, 'short')" class="switch_source" href="#">&gt;&gt;&nbsp; </a>%s</code>(tstr2htmlRUR(RRIRJt
q_long_sourcetq_source((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyR3�s
cCsd|j|j��S(Ns*&nbsp;&nbsp;<code class="source">%s</code>(RdRk(RRl((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyRjscCsd|j|�S(Ns
<pre>%s</pre>(Rd(RR'((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyR-sc	Cs�t|t�r[|j|�}d|krAd||j|�fSd||j|�fSn�t|t�rz|j||�St|ttf�r�|j|�r�d|dj	t
|jt
t|���fSd||jt|��fSdS(Ns
s%s:<br><pre>%s</pre>s%s: <tt>%s</tt>s$%s: <tt>[<br>
&nbsp; &nbsp; %s]</tt>s,<br>&nbsp; &nbsp; (RRR\RdRrtzebra_tableRuRR`RptmapRZ(RR@RARBR((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyRs)cCs�g|dD]\}}|^q|d*|j|�x8d	D]0}|jg||D]\}}|^qR�q;W|dr�|jdd�|jg|dD]\}}|^q��|jd�n|j|�}|jr�tt|S|SdS(
NRiRRRsS<script type="text/javascript">
show_button('extra_data', 'extra data');
</script>
s*<div id="extra_data" class="hidden-data">
s</div>(snormalssupplemental(R R(RnRt	error_cssthide_display_js(RRMRCRLRoRBR>ttext((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyR;s'

.
*	t	variablesc		Cst|t�r(|j�}|j�nd|d|j|�g}t}x�|D]�\}}yt|�}Wntk
r�}d|}nX|}|jd|r�dp�d|j|�f�|jdt	|jt
|����qRW|jd�d	j|�S(
Ns<table class="%s">s/<tr class="header"><th colspan="2">%s</th></tr>sCannot print: %ss<tr class="%s"><td>%s</td>toddtevens<td><tt>%s</tt></td></tr>s</table>s
(RRrRR:RdRURZRsR tmake_wrappableRtRp(	RRAtrowsttable_classttableR�R>RBRw((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyR~.s*
#!
(R6RaRdR+ReRRnR1R3RjR-RR;R~(((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyRy�s											s�
<script type="text/javascript">
function hide_display(id) {
    var el = document.getElementById(id);
    if (el.className == "hidden-data") {
        el.className = "";
        return true;
    } else {
        el.className = "hidden-data";
        return false;
    }
}
document.write('<style type="text/css">\n');
document.write('.hidden-data {display: none}\n');
document.write('</style>\n');
function show_button(toggle_id, name) {
    document.write('<a href="#' + toggle_id
        + '" onclick="javascript:hide_display(\'' + toggle_id
        + '\')" class="button">' + name + '</a><br>');
}

function switch_source(el, hide_type) {
    while (el) {
        if (el.getAttribute &&
            el.getAttribute('source-type') == hide_type) {
            break;
        }
        el = el.parentNode;
    }
    if (! el) {
        return false;
    }
    el.style.display = 'none';
    if (hide_type == 'long') {
        while (el) {
            if (el.getAttribute &&
                el.getAttribute('source-type') == 'short') {
                break;
            }
            el = el.nextSibling;
        }
    } else {
        while (el) {
            if (el.getAttribute &&
                el.getAttribute('source-type') == 'long') {
                break;
            }
            el = el.previousSibling;
        }
    }
    if (el) {
        el.style.display = '';
    }
    return false;
}

</script>sh
<style type="text/css">
body {
  font-family: Helvetica, sans-serif;
}

table {
  width: 100%;
}

tr.header {
  background-color: #006;
  color: #fff;
}

tr.even {
  background-color: #ddd;
}

table.variables td {
  vertical-align: top;
  overflow: auto;
}

a.button {
  background-color: #ccc;
  border: 2px outset #aaa;
  color: #000;
  text-decoration: none;
}

a.button:hover {
  background-color: #ddd;
}

code.source {
  color: #006;
}

a.switch_source {
  color: #090;
  text-decoration: none;
}

a.switch_source:hover {
  background-color: #ddd;
}

.source-highlight {
  background-color: #ff9;
}

</style>
cKs�|st|�j|�St|dt|�}t|d<t|d<t|dt|�}t|dt|�}d||tj|�fS(NR
RR
s�
    %s
    <br>
    <script type="text/javascript">
    show_button('full_traceback', 'full traceback')
    </script>
    <div id="full_traceback" class="hidden-data">
    %s
    </div>
    <br>
    <script type="text/javascript">
    show_button('text_version', 'text version')
    </script>
    <div id="text_version" class="hidden-data">
    <textarea style="width: 100%%" rows=10 cols=60>%s</textarea>
    </div>
    (RyRNtformat_htmlRURtformat_textRR(R<tinclude_hidden_framestopstshort_ertlong_erttext_er((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyR��s

cKst|�j|�S(N(RcRN(R<R�((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyR��ss  +s
</?pre.*?>s<h3>ERROR: .*?</h3>icCs5y t|d|d|d|�SWnt|�SXdS(s�
    Convert a string to HTML.  Try to be really safe about it,
    returning a quoted version of the string if nothing else works.
    Rktindent_subsequentthighlight_innerN(t	_str2htmlR(tsrcRkR�R�((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyR{�scCsS|r|j�}n|}ygtj|dd�}tjd|�}tjd|�}tjdd|�}tjdd|�}Wnt|�}nX|j�}t	|�dkr�|dSd|}x`t
dt	|��D]I}|||||<|r�|t	|�d	kr�d
||||<q�q�Wdj|�}tjd�|�}|S(
Ntformtsnipts^[\n\r]{0,1}s[\n\r]{0,1}$iit is(<span class="source-highlight">%s</span>s<br>
cSsdt|jd��ddS(Ns&nbsp;iiR�(R0tgroup(tm((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyt<lambda>�s(
RkRR{terror_retsubtpre_retreRt
splitlinesR0trangeRpt
whitespace_re(R�RkR�R�torig_srcRCtindentti((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyR��s.
i�cCs2t|�|kr*||d d|dS|SdS(sC
    Truncate the string to the limit number of
    characters
    is...i��N(R0(tstringtlimit((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyRtsi<s;?&@!$#-/\"'cCst|�|kr|S|j�}g}x�|D]�}d}x�t|�|kr�x�|D]F}||krW|j|d�\}}	|||d7}|	}PqWqWWx9tdt|�|�D]}
|||
|
|!d7}q�Wd}q>W||7}|j|�q/Wdj|�S(NR�is<wbr>iR�(R0tsplitR�R Rp(thtmlt
wrap_limittsplit_ontwordst	new_wordstwordtwrapped_wordtchartfirsttrestR�((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyR�s&



cCs�|j�}g}xo|D]g}t|�|krsx?|D]4}||kr8|j|�}dj|�}Pq8q8Wn|j|�qWdj|�S(s�
    Like ``make_wrappable()`` but intended for text that will
    go in a ``<pre>`` block, so wrap on a line-by-line basis.
    s<wbr>s
(R�R0R�RpR (R�R�R�RCt	new_linesRR�Rx((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pytmake_pre_wrappable$s

(t__doc__RR�t
paste.utilRRRRRcRyR�R�RUR�R�tcompileR�R�R�R{R�RtR�R�(((sK/opt/alt/python27/lib/python2.7/site-packages/paste/exceptions/formatter.pyt<module>s.	�I�8	


Zerion Mini Shell 1.0