Ñò
ô†³Kc @ sz d Z d d k l Z d d k l Z d d k Z d d k l Z d g Z d d „ Z d e
f d „ ƒ YZ d
„ Z d S( sZ
Cascades through several applications, so long as applications
return ``404 Not Found``.
iÿÿÿÿ( t httpexceptions( t
convertersN( t StringIOt Cascadet 404c K sÎ t t t i | ƒ ƒ } g } xl | i ƒ D]^ \ } } | i d ƒ p t d | | f ƒ ‚ n | i | d | ƒ} | i | | f ƒ q+ W| i ƒ 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 ...
t appsL Bad configuration key %r (=%r); all configuration keys must start with 'app't global_conft catch( t mapt intR t aslistt itemst
startswitht
ValueErrort get_appt appendt sortR ( t loaderR R t
local_conft appst namet valueR t _[1]( ( s1 /usr/lib/python2.6/site-packages/paste/cascade.pyt make_cascade s
'c B s# e Z d Z d d „ Z d „ Z RS( 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” c C sÊ | | _ h | _ g | _ x– | D]Ž } t | t ƒ o t | i d d ƒ d ƒ } n t | t i ƒ o | } | i
} n t i | ƒ } | } | | i | <| i i | ƒ q" Wt
| i ƒ | _ d S( Ni i ( R t catch_codest catch_exceptionst
isinstancet strR t splitt NoneR t
HTTPExceptiont codet
get_exceptionR t tuple( t selft applicationsR t errort excR ( ( s1 /usr/lib/python2.6/site-packages/paste/cascade.pyt __init__9 s
c
s? g ‰ d ‡ ‡ ‡ f d † } y# t | i d d ƒ p d ƒ } Wn t j
o
d } n X| d j o÷ t } | d j p
| d j o° t i ƒ } | d j o | i | d i ƒ ƒ nl | } xb | d j oT | d i t | d ƒ ƒ } | p t
d ƒ ‚ n | i | ƒ | t | ƒ 8} qÇ W| i d ƒ n t
| d i | ƒ ƒ } | | d