Ñò ô†³Kc@sdZddklZddkZdgZddgZdefd„ƒYZdefd„ƒYZde fd „ƒYZ d efd „ƒYZ d e fd „ƒYZ de fd„ƒYZ defd„ƒYZde fd„ƒYZdefd„ƒYZd„Zee_dS(s Middleware to make internal requests and forward requests internally. When applied, several keys are added to the environment that will allow you to trigger recursive redirects and forwards. paste.recursive.include: When you call ``environ['paste.recursive.include'](new_path_info)`` a response will be returned. The response has a ``body`` attribute, a ``status`` attribute, and a ``headers`` attribute. paste.recursive.script_name: The ``SCRIPT_NAME`` at the point that recursive lives. Only paths underneath this path can be redirected to. paste.recursive.old_path_info: A list of previous ``PATH_INFO`` values from previous redirects. Raise ``ForwardRequestException(new_path_info)`` to do a forward (aborting the current request). iÿÿÿÿ(tStringIONtRecursiveMiddlewaretForwardRequestExceptiontCheckForRecursionMiddlewarecBseZd„Zd„ZRS(cCs||_||_dS(N(tapptenv(tselfRR((s3/usr/lib/python2.6/site-packages/paste/recursive.pyt__init__!s cCs|iddƒ}||iidgƒjo!td||idfƒ‚n|iidgƒ}|i|iiddƒƒ|i||ƒS(Nt PATH_INFOtspaste.recursive.old_path_infosGForwarding loop detected; %r visited twice (internal redirect path: %s)(tgetRtAssertionErrort setdefaulttappendR(Rtenvirontstart_responset path_infot old_path_info((s3/usr/lib/python2.6/site-packages/paste/recursive.pyt__call__%s (t__name__t __module__RR(((s3/usr/lib/python2.6/site-packages/paste/recursive.pyR s cBs#eZdZdd„Zd„ZRS(s} A WSGI middleware that allows for recursive and forwarded calls. All these calls go to the same 'application', but presumably that application acts differently with different URLs. The forwarded URLs must be relative to this container. Interface is entirely through the ``paste.recursive.forward`` and ``paste.recursive.include`` environmental keys. cCs ||_dS(N(t application(RRt global_conf((s3/usr/lib/python2.6/site-packages/paste/recursive.pyR=scCs¹t|i||ƒ|dˆidƒd|d<ˆidƒd|d<|i||ƒS(NR!iRit QUERY_STRING(tsplitR(RRR(turl(s3/usr/lib/python2.6/site-packages/paste/recursive.pyRÝs(RRR((R)(s3/usr/lib/python2.6/site-packages/paste/recursive.pyR&Üs((RR&(R"R)(s3/usr/lib/python2.6/site-packages/paste/recursive.pyR%Ûscs&dˆf‡fd†ƒY}||ƒS(NtEnvironForwardcseZ‡fd†ZRS(cs|iˆ|ƒS(N(R(Rtenviron_R(R(s3/usr/lib/python2.6/site-packages/paste/recursive.pyRæs(RRR((R(s3/usr/lib/python2.6/site-packages/paste/recursive.pyR*ås((RR*(R"R(s3/usr/lib/python2.6/site-packages/paste/recursive.pyR%äs( t TypeErrortwarningstwarntDeprecationWarningRtstrtobjectthasattrR(RR)RRRR%((R"R)R$Rs3/usr/lib/python2.6/site-packages/paste/recursive.pyR¨s<          N(RRRR R(((s3/usr/lib/python2.6/site-packages/paste/recursive.pyRVs Pt RecursivecBs/eZd„Zdd„Zd„Zd„ZRS(cCs.||_|iƒ|_||_||_dS(N(Rtcopytoriginal_environtprevious_environR(RRRR((s3/usr/lib/python2.6/site-packages/paste/recursive.pyRïs  cCsù|iiƒ}|o|i|ƒn|i|d<|iidƒ}|idƒo<|i|ƒptd||f‚|t|ƒd}n|idƒ pt‚d|}||dRR7(t __class__RRR5R (R((s3/usr/lib/python2.6/site-packages/paste/recursive.pyt__repr__s  N(RRRR RR@RF(((s3/usr/lib/python2.6/site-packages/paste/recursive.pyR3ís   RcBseZdZd„ZRS(s  The forwarder will try to restart the request, except with the new `path` (replacing ``PATH_INFO`` in the request). It must not be called after and headers have been returned. It returns an iterator that must be returned back up the call stack, so it must be used like: .. code-block:: python return environ['paste.recursive.forward'](path) Meaningful transformations cannot be done, since headers are sent directly to the server and cannot be inspected or rewritten. cCs&tidtdƒ|i||iƒS(NsKrecursive.Forwarder has been deprecated; please use ForwardRequestExceptioni(R-R.R/RR(RR((s3/usr/lib/python2.6/site-packages/paste/recursive.pyR@*s (RRRR@(((s3/usr/lib/python2.6/site-packages/paste/recursive.pyRsRcBseZdZd„ZRS(s§ Starts another request with the given path and adding or overwriting any values in the `extra_environ` dictionary. Returns an IncludeResponse object. c stƒ‰d‡fd†}|i||ƒ}z"x|D]}ˆi|ƒq7WWdt|dƒo|iƒnXˆiƒˆS(Ncs<|o|d|d|d‚n|ˆ_|ˆ_ˆiS(Niii(tstatustheaderstwrite(RGRHtexc_info(tresponse(s3/usr/lib/python2.6/site-packages/paste/recursive.pyR<s   tclose(tIncludedResponseR RRIR2RL(RRRtapp_iterts((RKs3/usr/lib/python2.6/site-packages/paste/recursive.pyR@:s  (RRRR@(((s3/usr/lib/python2.6/site-packages/paste/recursive.pyR2sRMcBsAeZd„Zd„Zd„Zd„Zd„ZeeƒZRS(cCs+d|_d|_tƒ|_d|_dS(N(R RHRGRtoutputR0(R((s3/usr/lib/python2.6/site-packages/paste/recursive.pyRNs   cCs,|iiƒ|_|iiƒd|_dS(N(RPtgetvalueR0RLR (R((s3/usr/lib/python2.6/site-packages/paste/recursive.pyRLTs cCs.|idj p td‚|ii|ƒdS(NsIThis response has already been closed and no further data can be written.(RPR R RI(RRO((s3/usr/lib/python2.6/site-packages/paste/recursive.pyRIYscCs|iS(N(tbody(R((s3/usr/lib/python2.6/site-packages/paste/recursive.pyt__str___scCs)|idjo|iiƒS|iSdS(N(R0R RPRQ(R((s3/usr/lib/python2.6/site-packages/paste/recursive.pyt body__getbs( RRRRLRIRSRTtpropertyRR(((s3/usr/lib/python2.6/site-packages/paste/recursive.pyRMLs      RcBseZdZd„ZRS(sk Like Includer, but just stores the app_iter response (be sure to call close on the response!) cs:tƒ‰d‡fd†}|i||ƒ}|ˆ_ˆS(Ncs<|o|d|d|d‚n|ˆ_|ˆ_ˆiS(Niii(RGRHRI(RGRHRJ(RK(s3/usr/lib/python2.6/site-packages/paste/recursive.pyRrs   (tIncludedAppIterResponseR RRN(RRRRN((RKs3/usr/lib/python2.6/site-packages/paste/recursive.pyR@ps   (RRRR@(((s3/usr/lib/python2.6/site-packages/paste/recursive.pyRjsRVcBs#eZd„Zd„Zd„ZRS(cCs1d|_d|_g|_d|_t|_dS(N(R RGRHt accumulatedRNtFalset_closed(R((s3/usr/lib/python2.6/site-packages/paste/recursive.pyR~s     cCs=|i p td‚t|idƒo|iiƒndS(NsTried to close twiceRL(RYR R2RNRL(R((s3/usr/lib/python2.6/site-packages/paste/recursive.pyRL…scCs|iidS(N(RWR (RRO((s3/usr/lib/python2.6/site-packages/paste/recursive.pyRI‹s(RRRRLRI(((s3/usr/lib/python2.6/site-packages/paste/recursive.pyRV|s  cCs t|ƒS(N(R(RR((s3/usr/lib/python2.6/site-packages/paste/recursive.pytmake_recursive_middlewareŽs(Rt cStringIORR-t__all__t __pudge_all__R1RRt ExceptionRR3RRRMRRVRZ(((s3/usr/lib/python2.6/site-packages/paste/recursive.pyts   %—*