Ñò ô†³Kc@szdZddklZddklZddkZddklZdgZdd„Z de fd „ƒYZ d „Z dS( sZ Cascades through several applications, so long as applications return ``404 Not Found``. iÿÿÿÿ(thttpexceptions(t convertersN(tStringIOtCascadet404c KsÎttti|ƒƒ}g}xl|iƒD]^\}}|idƒptd||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 ... tappsLBad configuration key %r (=%r); all configuration keys must start with 'app't global_conftcatch( tmaptintRtaslisttitemst startswitht ValueErrortget_apptappendtsortR( tloaderRRt local_conftappstnametvalueRt_[1]((s1/usr/lib/python2.6/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Ê||_h|_g|_x–|D]Ž}t|tƒo t|iddƒdƒ}nt|ti ƒo|}|i }nti |ƒ}|}||i|<|ii |ƒq"Wt |iƒ|_dS(Nii(Rt catch_codestcatch_exceptionst isinstancetstrR tsplittNoneRt HTTPExceptiontcodet get_exceptionRttuple(tselft applicationsRterrortexcR((s1/usr/lib/python2.6/site-packages/paste/cascade.pyt__init__9s      c s?g‰d ‡‡‡fd†}y#t|iddƒpdƒ}Wntj o d}nX|djo÷t}|djp |djo°tiƒ}|djo|i|diƒƒnl|}xb|djoT|dit |dƒƒ}|pt dƒ‚n|i|ƒ|t |ƒ8}qÇW|i dƒnt |di|ƒƒ}||ds   Y