Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
contego / home / tvault / .virtenv / lib / python2.7 / site-packages / paste / response.pyc
Size: Mime:
ó
ª‹EYc@szdZddlZdefd„ƒYZd„Zd„Zd„Zd„Zed	„Z	ded
„Zded„ZdS(s#Routines to generate WSGI responsesiÿÿÿÿNt
HeaderDictcBs’eZdZd„Zd„Zd„Zd„ZeZd
d„Z	d
d„Z
d„Zd„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((sC/home/tvault/.virtenv/lib/python2.7/site-packages/paste/response.pyRscCs tj||j|ƒ|ƒdS(N(Rt__setitem__R(RRtvalue((sC/home/tvault/.virtenv/lib/python2.7/site-packages/paste/response.pyR scCstj||j|ƒƒdS(N(Rt__delitem__R(RR((sC/home/tvault/.virtenv/lib/python2.7/site-packages/paste/response.pyR#scCstj||j|ƒƒS(N(Rt__contains__R(RR((sC/home/tvault/.virtenv/lib/python2.7/site-packages/paste/response.pyR	&scCstj||j|ƒ|ƒS(N(RtgetR(RRtfailobj((sC/home/tvault/.virtenv/lib/python2.7/site-packages/paste/response.pyR
+scCstj||j|ƒ|ƒS(N(Rt
setdefaultR(RRR((sC/home/tvault/.virtenv/lib/python2.7/site-packages/paste/response.pyR.scGstj||j|ƒ|ŒS(N(RtpopR(RRtargs((sC/home/tvault/.virtenv/lib/python2.7/site-packages/paste/response.pyR
1scCs,x%|D]}||||j|ƒ<qWdS(N(R(RtotherR((sC/home/tvault/.virtenv/lib/python2.7/site-packages/paste/response.pytupdate4s
cCst|ƒjƒjƒS(N(tstrtlowertstrip(RR((sC/home/tvault/.virtenv/lib/python2.7/site-packages/paste/response.pyR8scCsg|j|ƒ}||krYt||tƒrB||j|ƒqc|||g||<n
|||<dS(N(Rt
isinstancetlisttappend(RRR((sC/home/tvault/.virtenv/lib/python2.7/site-packages/paste/response.pytadd;scCs|g}xo|jƒD]a\}}t|tƒr[xC|D]}|j|t|ƒfƒq5Wq|j|t|ƒfƒqW|S(N(titemsRRRR(RtresultRRtv((sC/home/tvault/.virtenv/lib/python2.7/site-packages/paste/response.pytheaderitemsEs
 cCs4|ƒ}x$|D]\}}|j||ƒqW|S(N(R(tclstseqRtnameR((sC/home/tvault/.virtenv/lib/python2.7/site-packages/paste/response.pytfromlistPs	N(t__name__t
__module__t__doc__RRRR	thas_keytNoneR
RR
RRRRRtclassmethod(((sC/home/tvault/.virtenv/lib/python2.7/site-packages/paste/response.pyR
s								
		cCs=|jƒ}x*|D]"\}}|jƒ|krtSqWtS(s6
    Is header named ``name`` present in headers?
    (RtTruetFalse(theadersRtheaderR((sC/home/tvault/.virtenv/lib/python2.7/site-packages/paste/response.pyt
has_headerXs
cCsX|jƒ}g|D]$\}}|jƒ|kr|^q}|rPdj|ƒSdSdS(s±
    Returns the header's value, or None if no such header.  If a
    header appears more than once, all the values of the headers
    are joined with ','.   Note that this is consistent /w RFC 2616
    section 4.2 which states:

        It MUST be possible to combine the multiple header fields
        into one "field-name: field-value" pair, without changing
        the semantics of the message, by appending each subsequent
        field-value to the first, each separated by a comma.

    However, note that the original netscape usage of 'Set-Cookie',
    especially in MSIE which contains an 'expires' date will is not
    compatible with this particular concatination method.
    t,N(RtjoinR$(R(RR)RR((sC/home/tvault/.virtenv/lib/python2.7/site-packages/paste/response.pytheader_valuebs
cCst|jƒ}d}d}xU|t|ƒkro||djƒ|krb||d}||=qn|d7}qW|S(sÂ
    Removes the named header from the list of headers.  Returns the
    value of that header, or None if no header found.  If multiple
    headers are found, only the last one is returned.
    iiN(RR$tlen(R(RtiR((sC/home/tvault/.virtenv/lib/python2.7/site-packages/paste/response.pyt
remove_headerzscCs­|jƒ}d}d}xr|t|ƒkrŒ||djƒ|kr|s^td|ƒ‚||d}||f||<n|d7}qW|s©|j||fƒn|S(s
    Updates the headers replacing the first occurance of the given name
    with the value provided; asserting that no further occurances
    happen. Note that this is _not_ the same as remove_header and then
    append, as two distinct operations (del followed by an append) are
    not atomic in a threaded environment. Returns the previous header
    value for the provided name, if any.   Clearly one should not use
    this function with ``set-cookie`` or other names that may have more
    than one occurance in the headers.
    is$two values for the header '%s' foundiN(RR$R.tAssertionErrorR(R(RRR/R((sC/home/tvault/.virtenv/lib/python2.7/site-packages/paste/response.pytreplace_header‹scCs2|rtjdtdƒndi|d6|d6S(s[
    Returns a standard HTML response page for an HTTP error.
    **Note:** Deprecated
    smwsgilib.error_body_response is deprecated; use the wsgi_application method on an HTTPException object insteadis~<html>
  <head>
    <title>%(error_code)s</title>
  </head>
  <body>
  <h1>%(error_code)s</h1>
  %(message)s
  </body>
</html>t
error_codetmessage(twarningstwarntDeprecationWarning(R3R4t__warn((sC/home/tvault/.virtenv/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 <a href="%s">%s</a>'
            % (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


<!-- %s -->R8scontent-types	text/htmlscontent-length(scontent-types	text/html(R5R6R7R
R9R'RR.(tenvironR3R4t
debug_messageR8tbodyR(((sC/home/tvault/.virtenv/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<R8(R>R'(R;tstart_responsetstatusR(R=(R<R3R4(sC/home/tvault/.virtenv/lib/python2.7/site-packages/paste/response.pytapplicationês

(R5R6R7(R3R4R<R8RA((R<R3R4sC/home/tvault/.virtenv/lib/python2.7/site-packages/paste/response.pyterror_response_appÞs
(
R"R5RRR*R-R0R2R&R9R$R>RB(((sC/home/tvault/.virtenv/lib/python2.7/site-packages/paste/response.pyt<module>sN