ó aòNc@szdZddlZdefd„ƒYZd„Zd„Zd„Zd„Zed „Z ded „Z ded „Z dS( s#Routines to generate WSGI responsesiÿÿÿÿNt HeaderDictcBs’eZdZd„Zd„Zd„Zd„ZeZd d„Z d d„Z d„Z d„Z d „Z d „Zd „Zd „ZeeƒZRS(sI This represents response headers. It handles the headers as a dictionary, with case-insensitive keys. Also there is an ``.add(key, value)`` method, which sets the key, or adds the value to the current value (turning it into a list if necessary). For passing to WSGI there is a ``.headeritems()`` method which is like ``.items()`` but unpacks value that are lists. It also handles encoding -- all headers are encoded in ASCII (if they are unicode). @@: Should that encoding be ISO-8859-1 or UTF-8? I'm not sure what the spec says. cCstj||j|ƒƒS(N(tdictt __getitem__t normalize(tselftkey((s?/opt/alt/python27/lib/python2.7/site-packages/paste/response.pyRscCs tj||j|ƒ|ƒdS(N(Rt __setitem__R(RRtvalue((s?/opt/alt/python27/lib/python2.7/site-packages/paste/response.pyR scCstj||j|ƒƒdS(N(Rt __delitem__R(RR((s?/opt/alt/python27/lib/python2.7/site-packages/paste/response.pyR#scCstj||j|ƒƒS(N(Rt __contains__R(RR((s?/opt/alt/python27/lib/python2.7/site-packages/paste/response.pyR &scCstj||j|ƒ|ƒS(N(RtgetR(RRtfailobj((s?/opt/alt/python27/lib/python2.7/site-packages/paste/response.pyR +scCstj||j|ƒ|ƒS(N(Rt setdefaultR(RRR ((s?/opt/alt/python27/lib/python2.7/site-packages/paste/response.pyR .scGstj||j|ƒ|ŒS(N(RtpopR(RRtargs((s?/opt/alt/python27/lib/python2.7/site-packages/paste/response.pyR 1scCs,x%|D]}||||j|ƒ %(error_code)s

%(error_code)s

%(message)s t error_codetmessage(twarningstwarntDeprecationWarning(R2R3t__warn((s?/opt/alt/python27/lib/python2.7/site-packages/paste/response.pyterror_body_response¨s cCsŽ|rtjdtdƒn|rN|jdiƒjdƒrN|d|7}nt||dtƒ}d d tt|ƒƒfg}|||fS( s_ Returns the status, headers, and body of an error response. Use like: .. code-block:: python status, headers, body = wsgilib.error_response( '301 Moved Permanently', 'Moved to %s' % (url, url)) start_response(status, headers) return [body] **Note:** Deprecated shwsgilib.error_response is deprecated; use the wsgi_application method on an HTTPException object insteadis paste.configtdebugs R7s content-types text/htmlscontent-length(s content-types text/html(R4R5R6R R8R'RR.(tenvironR2R3t debug_messageR7tbodyR(((s?/opt/alt/python27/lib/python2.7/site-packages/paste/response.pyterror_responseÁs !cs5|rtjdtdƒn‡‡‡fd†}|S(sW An application that emits the given error response. **Note:** Deprecated slwsgilib.error_response_app is deprecated; use the wsgi_application method on an HTTPException object insteadics;t|ˆˆdˆdtƒ\}}}|||ƒ|gS(NR;R7(R=R'(R:tstart_responsetstatusR(R<(R;R2R3(s?/opt/alt/python27/lib/python2.7/site-packages/paste/response.pyt applicationês   (R4R5R6(R2R3R;R7R@((R;R2R3s?/opt/alt/python27/lib/python2.7/site-packages/paste/response.pyterror_response_appÞs  ( R"R4RRR*R-R0R1R&R8R$R=RA(((s?/opt/alt/python27/lib/python2.7/site-packages/paste/response.pyts N