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 / webob / response.pyc
Size: Mime:
ó
¨‹EYc@s¦ddlmZddlmZmZddlmZddlZddlZddlZyddl	Z
Wnek
r‰ddl
Z
nXddlm
Z
ddlmZmZddlmZmZmZmZmZmZddlmZmZdd	lmZmZmZdd
lm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.ddl/m0Z0ddl1m2Z2dd
l3m4Z4m5Z5m6Z6dgZ7ej8dej9ƒZ:ej8dej9ƒZ;dZ<e=ƒZ>de=fd„ƒYZ?ddfd„Z@dd>d„ZAde=fd„ƒYZBde=fd„ƒYZCde=fd„ƒYZDd„ZEd „ZFd!„ZGd"„ZHd#„ZId$„ZJdS(%iÿÿÿÿ(t	b64encode(tdatetimet	timedelta(tmd5N(tContentRange(tCacheControltserialize_cache_control(tPY3tbytes_tnative_t	text_typet	url_quoteturlparse(tCookietmake_cookie(tparse_date_deltatserialize_date_deltattimedelta_to_seconds(t
CHARSET_REt	SCHEME_REt	convertertdate_headert
header_gettertlist_headert
parse_authtparse_content_rangetparse_etag_responset	parse_inttparse_int_safetserialize_authtserialize_content_rangetserialize_etag_responset
serialize_int(tResponseHeaders(tBaseRequest(tstatus_reasonststatus_generic_reasonstwarn_deprecationtResponses(([a-z0-9]+)=(?:"([^"]*)"|([a-z0-9_.-]*))s^[a-z0-9_.-]+$s
‹ÿcBs±eZdZdZdZdZeZdZdqZ
dqZdqdqdqdqdqdqed„Z
ed„ƒZd„Zd„Zed„Zd	„Zd
„ZeeedejƒZd„Zd
„ZeeedejƒZZd„Zd„Zd„ZeeeedejƒZd„Zd„Z eee dejƒZ!d„Z"dd„Z#ee"e#e#ƒZ$d„Z%d„Z&d„Z'ee%e&e'ƒZ(Z)d„Z*ee*ƒZ+d„Z,d„Z-d„Z.ee,e-e.de,jƒZ/ee,e-e.dƒZ0Z1d„Z2d„Z3d „Z4ee2e3e4de2jƒZ5d!„Z6d"„Z7d#„Z8d$„Z9ee7e8e9de7jƒZ:e;d%d&ƒZ<e;d'd(ƒZ=e>e?d)d*ƒe@eAd+ƒZBe?d,d-ƒZCe;d.d/ƒZDe?d0d1ƒZEe?d2d1ƒZFe?d3d4ƒZGe?d5d6ƒZHe>e?d7d8ƒeIeJd9ƒZKeLd:d;ƒZMeLd<d=ƒZNeLd>d?ƒZOe?d@dAƒZPe>ePeQeRdBƒZSedC„ƒZTe?dDdEƒZUe?dFdGƒZVe>e?dHdIƒeWeAd+ƒZXe>e?dJdKƒeYeZdLƒZ[e?dMdNƒZ\e>e?dOdPƒe]e^ƒZ_dQ„Z`dR„ZadS„Zbee`eaebde`jƒZcdT„ZddU„ZedV„ZfeedeeefdedjƒZgdW„ZhdX„ZidY„ZjeeheiejehjƒZkdqddqdZdqeedqdqed[„
ZldZdqd\„Zmend]„Zod^„ZpdqZqd_„Zrd`„Zsda„Ztdb„ZueeresetderjƒZvdcdd„Zwede„ewƒZxdfedg„Zydh„Zzdqedi„Z{e|dj„ƒZ}dk„Z~dl„ZdrZ€do„Zdp„Z‚RS(ss
    Represents a WSGI response.

    If no arguments are passed, creates a :class:`~Response` that uses a
    variety of defaults. The defaults may be changed by sub-classing the
    :class:`~Response`. See the :ref:`sub-classing notes
    <response_subclassing_notes>`.

    :cvar ~Response.body: If ``body`` is a ``text_type``, then it will be
        encoded using either ``charset`` when provided or ``default_encoding``
        when ``charset`` is not provided if the ``content_type`` allows for a
        ``charset``. This argument is mutually  exclusive with ``app_iter``.

    :vartype ~Response.body: bytes or text_type

    :cvar ~Response.status: Either an :class:`int` or a string that is
        an integer followed by the status text. If it is an integer, it will be
        converted to a proper status that also includes the status text.  Any
        existing status text will be kept. Non-standard values are allowed.

    :vartype ~Response.status: int or str

    :cvar ~Response.headerlist: A list of HTTP headers for the response.

    :vartype ~Response.headerlist: list

    :cvar ~Response.app_iter: An iterator that is used as the body of the
        response. Should conform to the WSGI requirements and should provide
        bytes. This argument is mutually exclusive with ``body``.

    :vartype ~Response.app_iter: iterable

    :cvar ~Response.content_type: Sets the ``Content-Type`` header. If no
        ``content_type`` is provided, and there is no ``headerlist``, the
        ``default_content_type`` will be automatically set. If ``headerlist``
        is provided then this value is ignored.

    :vartype ~Response.content_type: str or None

    :cvar conditional_response: Used to change the behavior of the
        :class:`~Response` to check the original request for conditional
        response headers. See :meth:`~Response.conditional_response_app` for
        more information.

    :vartype conditional_response: bool

    :cvar ~Response.charset: Adds a ``charset`` ``Content-Type`` parameter. If
        no ``charset`` is provided and the ``Content-Type`` is text, then the
        ``default_charset`` will automatically be added.  Currently the only
        ``Content-Type``'s that allow for a ``charset`` are defined to be
        ``text/*``, ``application/xml``, and ``*/*+xml``. Any other
        ``Content-Type``'s will not have a ``charset`` added. If a
        ``headerlist`` is provided this value is ignored.

    :vartype ~Response.charset: str or None

    All other response attributes may be set on the response by providing them
    as keyword arguments. A :exc:`TypeError` will be raised for any unexpected
    keywords.

    .. _response_subclassing_notes:

    **Sub-classing notes:**

    * The ``default_content_type`` is used as the default for the
      ``Content-Type`` header that is returned on the response. It is
      ``text/html``.

    * The ``default_charset`` is used as the default character set to return on
      the ``Content-Type`` header, if the ``Content-Type`` allows for a
      ``charset`` parameter. Currently the only ``Content-Type``'s that allow
      for a ``charset`` are defined to be: ``text/*``, ``application/xml``, and
      ``*/*+xml``. Any other ``Content-Type``'s will not have a ``charset``
      added.

    * The ``unicode_errors`` is set to ``strict``, and access on a
      :attr:`~Response.text` will raise an error if it fails to decode the
      :attr:`~Response.body`.

    * ``default_conditional_response`` is set to False. This flag may be set to
      True so that all ``Response`` objects will attempt to check the original
      request for conditional response headers. See
      :meth:`~Response.conditional_response_app` for more information.

    * ``default_body_encoding`` is set to 'UTF-8' by default, it exists to
      allow users to get/set the Response object using .text, even if no
      charset has been set for the Content-Type.
    s	text/htmlsUTF-8tstrictcKsœ|dkr“|dkr“d|ks0d|kr“d|krN|jdƒ}	n|jdƒ}	tj|	ddƒjdƒ}|dkr“d}q“n|dkr·|dkrÒd}qÒn|dk	rÒtd	ƒ‚n|dkrêd
|_n	||_d|_|dkrg|_	n	||_	d}
|t
k	r8|}
n|jddko[|jd
 dk}|pj|j}|dkr|r|rd|k}|r d}
n|
}
|rÎ|t
krÎ|jrÎ|j}
n|
rý|dksìt
|ƒrý|d|
7}n|j	jd|fƒn|dkr1|j|_nt|ƒ|_|dkr|rt|tƒr|
pm|j}
|
dkr‹tdƒ‚n|j|
ƒ}n|g}|dk	róg|j	D]*\}}|jƒdkr¼||f^q¼|j	(n|j	jdtt|ƒƒfƒn|dkr7|r7dg}n||_xU|jƒD]G\}}t|j|ƒs„td||fƒ‚nt|||ƒqMWdS(Nt	json_bodytjsont
separatorst,t:sUTF-8sapplication/jsonts8You may only give one of the body and app_iter argumentss200 OKit1it204t205t304scharset=s	text/htmls
; charset=sContent-Types9You cannot set the body to a text value without a charsetscontent-lengthsContent-LengthsUnexpected keyword: %s=%r(R+R,(R/R0R1(tNonetpopR)tdumpstencodet	TypeErrort_statuststatust_headerst_headerlistt_markertdefault_content_typetdefault_charsett_content_type_has_charsettappendtdefault_conditional_responsetconditional_responsetboolt
isinstanceR
tcharsettlowertstrtlent	_app_itertitemsthasattrt	__class__tsetattr(tselftbodyR8t
headerlisttapp_itertcontent_typeRARDtkwR(tencodingt
code_has_bodythas_charsettnew_charsettktvtnametvalue((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt__init__´s€0							+%	cCsvg}|jƒjƒ}t|tƒ}|r<d}d}nd}d}|j|ƒr‘|jddƒ\}}}	dt|ƒt|	ƒf}nx|jƒjƒ}
|
s°Pny|
j|dƒ\}}Wn!tk
rïtd|
ƒ‚nX|jƒ}|j	t|dƒt|dƒfƒq”|d|d	|d
d
ƒ}
|j
|
jpQdƒ}|ri||
_n	||
_
|
S(soReads a response from a file-like object (it must implement
        ``.read(size)`` and ``.readline()``).

        It will read up to the end of the response, not the end of the
        file.

        This reads the response as represented by ``str(resp)``; it
        may not read every valid HTTP response properly.  Responses
        must have a ``Content-Length``R,sHTTP/is%s %sisBad header line: %rslatin-1R8RORPiN((treadlinetstripRCR
t
startswithtsplitR2R	t
ValueErrorR?treadtcontent_lengthttextRN(tclstfpROR8tis_textt_colont_httpthttp_vert
status_numtstatus_texttlinetheader_nameRZtrRN((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt	from_filePs@	
		c	CsWt|jƒ}t|jƒt|ƒ|_|jd|jd|jd|d|jƒS(sMakes a copy of the responseR8RORPRA(tlistRHt
iter_closeRKR7R:RA(RMRP((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pytcopy„s
		
cCs&d|jjtt|ƒƒ|jfS(Ns<%s at 0x%x %s>(RKt__name__tabstidR8(RM((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt__repr__•scCsw|jg}|s|jn|tdj|jƒ7}|rj|jrj|dtrZ|jn|jg7}ndj|ƒS(Ns%s: %sR-s
(R8RNtmapt__mod__RORRctjoin(RMt	skip_bodytparts((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt__str__™s
%cCs|jS(s#
        The status string
        (R7(RM((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_status__get§scCsïyt|ƒ}Wnttfk
r)nX||_dStrat|tƒr‚|jdƒ}q‚n!t|tƒr‚|j	dƒ}nt|t
ƒsªtdt|ƒƒ‚nyt|jƒdƒWntk
rátdƒ‚nX||_
dS(Ntasciis3You must set status to a string or integer (not %s)is&Invalid status code, integer required.(tintR`R6tstatus_codeRRCtbytestdecodeR
R5RFttypeR_R7(RMRZtcode((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_status__set­s(	
tdoccCst|jjƒdƒS(s*
        The status as an integer
        i(RR7R_(RM((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_status_code__getËscCsNyd|t|f|_Wn,tk
rId|t|df|_nXdS(Ns%d %sid(R#R7tKeyErrorR$(RMR„((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_status_code__setÑs
cCs|jS(s.
        The list of response headers
        (R:(RM((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_headerlist__getÞscCsRd|_t|tƒsEt|dƒr6|jƒ}nt|ƒ}n||_dS(NRI(R2R9RCRpRJRIR:(RMRZ((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_headerlist__setäs	cCs
g|_dS(N(RO(RM((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_headerlist__delìscCs.|jdkr'tj|jƒ|_n|jS(s9
        The headers in a dictionary-like object
        N(R9R2R!t	view_listR:(RM((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt
_headers__getòscCs4t|dƒr|jƒ}n||_d|_dS(NRI(RJRIROR2R9(RMRZ((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt
_headers__setús	cCs|j}t|tƒr2t|ƒdkr2|dS|dkrMtdƒ‚nzdj|ƒ}Wdt|ƒXt|tƒrt	||ƒ‚n|g|_t|ƒdkr°nX|j
dkrÑt|ƒ|_
n7|j
t|ƒkrtd|j
t|ƒfƒ‚n|S(s}
        The body of the response, as a :class:`bytes`.  This will read in
        the entire app_iter if necessary.
        iisNo body has been setR-Ns@Content-Length is different from actual app_iter length (%r!=%r)(RHRCRpRGR2tAttributeErrorRyRqR
t_error_unicode_in_app_iterRbtAssertionError(RMRPRN((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt
_body__gets(	!R-cCs€t|tƒsFt|tƒr'd}ndt|ƒ}t|ƒ‚n|jdk	rad|_n|g|_t|ƒ|_	dS(NsAYou cannot set Response.body to a text object (use Response.text)s3You can only set the body to a binary type (not %s)(
RCRR
RƒR6RHR2tcontent_md5RGRb(RMRZtmsg((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt
_body__set*s	
cCstj|jjdƒƒS(sA
        Set/get the body of the response as JSON

        .. note::

           This will automatically :meth:`~bytes.decode` the
           :attr:`~Response.body` as ``UTF-8`` on get, and
           :meth:`~str.encode` the :meth:`json.dumps` as ``UTF-8``
           before assigning to :attr:`~Response.body`.

        sUTF-8(R)tloadsRNR‚(RM((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_json_body__get>s
cCs%tj|ddƒjdƒ|_dS(NR*R+R,sUTF-8(R+R,(R)R4R5RN(RMRZ((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_json_body__setMscCs
|`dS(N(RN(RM((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_json_body__delPscCsY|j}t|tƒrEt|ƒdkrE|ddkr>tStSn|dkrUtStS(sÝ
        Determine if the the response has a :attr:`~Response.body`. In
        contrast to simply accessing :attr:`~Response.body` this method
        will **not** read the underlying :attr:`~Response.app_iter`.
        iiR-N(RHRCRpRGtTruetFalseR2(RMRP((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_has_body__getUs	!cCsQ|jr#|jr#tdƒ‚n|jp2|j}|j}|j||jƒS(s€
        Get/set the text value of the body using the charset of the
        Content-Type or the default_body_encoding.
        sNYou cannot access Response.text unless charset or default_body_encoding is set(RDtdefault_body_encodingRRNR‚tunicode_errors(RMtdecodingRN((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt
_text__getos	cCss|jr#|jr#tdƒ‚nt|tƒsKtdt|ƒƒ‚n|jpZ|j}|j|ƒ|_dS(NsNYou cannot access Response.text unless charset or default_body_encoding is sets;You can only set Response.text to a unicode string (not %s)(	RDRžRRCR
R6RƒR5RN(RMRZRS((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt
_text__set}scCs
|`dS(N(RN(RM((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt
_text__delŠssDeprecated alias for .textcCs
t|ƒS(s¨
        A file-like object that can be used to write to the
        body.  If you passed in a list app_iter, that app_iter will be
        modified by writes.
        (tResponseBodyFile(RM((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_body_file__get–scCst|ƒ|_dS(N(t	iter_fileRP(RMtfile((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_body_file__setžscCs
|`dS(N(RN(RM((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_body_file__del¡scCst|tƒspt|tƒs=d}t|t|ƒƒ‚n|js[d}t|ƒ‚n|j|jƒ}n|j}t|tƒsÏzt|ƒ}|_Wdt	|ƒX|}t
d„|Dƒƒ|_n|j|ƒ|jdk	r|jt|ƒ7_ndS(Ns6You can only write str to a Response.body_file, not %ss;You can only write text to Response if charset has been setcss|]}t|ƒVqdS(N(RG(t.0tchunk((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pys	<genexpr>¸s(RCRR
R6RƒRDR5RHRpRqtsumRbR?R2RG(RMRcR•RPtnew_app_iter((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pytwrite§s$		
cCs|jS(sš
        Returns the app_iter of the response.

        If body was set, this will create an app_iter from that body
        (a single-item list)
        (RH(RM((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_app_iter__getÁscCs1|jdk	r$d|_d|_n||_dS(N(RHR2RbR”(RMRZ((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_app_iter__setÊs	cCsg|_d|_dS(N(RHR2Rb(RM((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_app_iter__delÑs	tAllows14.7tVarys14.44sContent-Lengths14.17RsContent-Encodings14.11sContent-Languages14.12sContent-Locations14.14sContent-MD5sContent-Dispositions19.5.1s
Accept-Rangess14.5s
Content-Ranges14.16sContentRange objecttDates14.18tExpiress14.21s
Last-Modifieds14.29tETags14.19s
Entity tagcCst|jdtƒS(Ntstrong(Rt	_etag_rawR›(RM((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pytetag_strongústLocations14.30tPragmas14.32tAges14.6sRetry-Afters14.37sHTTP date or delta secondstServers14.38sWWW-Authenticates14.47cCsB|jjdƒ}|sdStj|ƒ}|r>|jdƒSdS(s³
        Get/set the charset specified in Content-Type.

        There is no checking to validate that a ``content_type`` actually allows
        for a charset parameter.
        sContent-TypeiN(theaderstgetR2Rtsearchtgroup(RMtheadertmatch((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt
_charset__gets
cCsŸ|dkr|jƒdS|jjddƒ}|dkrJtdƒ‚ntj|ƒ}|r€||jƒ ||jƒ}n|d|7}||jd<dS(NsContent-Types:You cannot set the charset when no content-type is defineds; charset=%s(	R2t
_charset__delR¾R¿RRRÀtstarttend(RMRDRÂRÃ((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt
_charset__set#s
!cCsl|jjddƒ}|dkr%dStj|ƒ}|r[||jƒ ||jƒ}n||jd<dS(NsContent-Type(R¾R3R2RRÀRÆRÇ(RMRÂRÃ((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyRÅ1s!cCs0|jjdƒ}|sdS|jddƒdS(s«
        Get/set the Content-Type header. If no Content-Type header is set, this
        will return None.

        .. versionchanged:: 1.7

            Setting a new Content-Type will remove all Content-Type parameters
            and reset the charset to the default if the Content-Type is
            ``text/*`` or XML (``application/xml``, or ``*/*+xml``)

            To preserve all Content-Type parameters you may use the following
            code:

            .. code::

                resp = Response()
                params = resp.content_type_params
                resp.content_type = 'application/something'
                resp.content_type_params = params
        sContent-Typet;iiN(R¾R¿R2R_(RMRÂ((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_content_type__getBscCsˆ|s|jƒdS|}d|k}d}|rH|jrH|j}n|rw|dksft|ƒrw|d|7}n||jd<dS(Nscharset=s	text/htmls
; charset=sContent-Type(t_content_type__delR2R=R>R¾(RMRZRQRURV((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_content_type__set\s
	cCs|jjddƒdS(NsContent-Type(R¾R3R2(RM((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyRËscCs|jjddƒ}d|kr%iS|jddƒd}i}xHtj|ƒD]7}|jdƒpx|jdƒpxd||jdƒ<qQW|S(s·
        A dictionary of all the parameters in the content type.

        (This is not a view, set to change, modifications of the dict will not
        be applied otherwise)
        sContent-TypeR-RÉiii(R¾R¿R_t	_PARAM_REtfinditerRÁ(RMtparamstresultRÃ((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_content_type_params__get‰s5cCsÅ|s|jƒdSg}x_t|jƒƒD]K\}}tj|ƒsad|jddƒ}n|jd||fƒq-W|jjddƒj	ddƒd	}|dj
|ƒ7}||jd<dS(
Ns"%s"t"s\"s; %s=%ssContent-TypeR-RÉii(t_content_type_params__deltsortedRIt_OK_PARAM_RERÀtreplaceR?R¾R3R_Ry(RMt
value_dictRÏRWRXtct((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_content_type_params__set™s
%cCs0|jjddƒjddƒd|jd<dS(NsContent-TypeR-RÉii(R¾R¿R_(RM((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyRÓ§s	t/cCs(|	rtdddƒn|dkr4tdƒ‚n|
rP|j|dtƒn|rot|	tƒro|	}n|rÌt|	tƒrÌ|	jr¹|	j	ƒr¹|	|	j	ƒj
ddƒ}	n|	tjƒ}nt|dƒ}t
||d|d	|d
|d|d|d
|ƒ}|jjd|fƒdS(sÞ
        Set (add) a cookie for the response.

        Arguments are:

        ``name``

           The cookie name.

        ``value``

           The cookie value, which should be a string or ``None``.  If
           ``value`` is ``None``, it's equivalent to calling the
           :meth:`webob.response.Response.unset_cookie` method for this
           cookie key (it effectively deletes the cookie on the client).

        ``max_age``

           An integer representing a number of seconds, ``datetime.timedelta``,
           or ``None``. This value is used as the ``Max-Age`` of the generated
           cookie.  If ``expires`` is not passed and this value is not
           ``None``, the ``max_age`` value will also influence the ``Expires``
           value of the cookie (``Expires`` will be set to now + max_age).  If
           this value is ``None``, the cookie will not have a ``Max-Age`` value
           (unless ``expires`` is set). If both ``max_age`` and ``expires`` are
           set, this value takes precedence.

        ``path``

           A string representing the cookie ``Path`` value.  It defaults to
           ``/``.

        ``domain``

           A string representing the cookie ``Domain``, or ``None``.  If
           domain is ``None``, no ``Domain`` value will be sent in the
           cookie.

        ``secure``

           A boolean.  If it's ``True``, the ``secure`` flag will be sent in
           the cookie, if it's ``False``, the ``secure`` flag will not be
           sent in the cookie.

        ``httponly``

           A boolean.  If it's ``True``, the ``HttpOnly`` flag will be sent
           in the cookie, if it's ``False``, the ``HttpOnly`` flag will not
           be sent in the cookie.

        ``comment``

           A string representing the cookie ``Comment`` value, or ``None``.
           If ``comment`` is ``None``, no ``Comment`` value will be sent in
           the cookie.

        ``expires``

           A ``datetime.timedelta`` object representing an amount of time,
           ``datetime.datetime`` or ``None``. A non-``None`` value is used to
           generate the ``Expires`` value of the generated cookie. If
           ``max_age`` is not passed, but this value is not ``None``, it will
           influence the ``Max-Age`` header. If this value is ``None``, the
           ``Expires`` cookie value will be unset (unless ``max_age`` is set).
           If ``max_age`` is set, it will be used to generate the ``expires``
           and this value is ignored.

           If a ``datetime.datetime`` is provided it has to either be timezone
           aware or be based on UTC. ``datetime.datetime`` objects that are
           local time are not supported. Timezone aware ``datetime.datetime``
           objects are converted to UTC.

           This argument will be removed in future
           versions of WebOb (version 1.9).

        ``overwrite``

           If this key is ``True``, before setting the cookie, unset any
           existing cookie.

        sVArgument "expires" will be removed in a future version of WebOb, please use "max_age".gš™™™™™ñ?is&set_cookie() takes at least 1 argumentR'ttzinfosutf-8tmax_agetpathtdomaintsecurethttponlytcomments
Set-CookieN(R%R2R6tunset_cookieRœRCRRRÛt	utcoffsetRÖtutcnowRRROR?(RMRYRZRÜRÝRÞRßRàRátexpirest	overwritetcookie((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt
set_cookie¶s&V
		cCs |j|dd|d|ƒdS(sò
        Delete a cookie from the client.  Note that path and domain must match
        how the cookie was originally set.

        This sets the cookie to the empty string, and max_age=0 so
        that it should expire immediately.
        RÝRÞN(RèR2(RMRYRÝRÞ((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt
delete_cookie,scCsÜ|jjdƒ}|r$|r$dStƒ}x|D]}|j|ƒq4Wt|tƒrl|jdƒ}n||kr¿||=|jd=xL|jƒD]"}|jj	d|j
ƒfƒq–Wn|rØtd|ƒ‚ndS(s[
        Unset a cookie with the given name (remove it from the
        response).
        s
Set-CookieNtutf8s'No cookie has been set with the name %r(R¾tgetallR
tloadRCR
R5tvaluesROR?t	serializeRˆ(RMRYR'texistingtcookiesRÂtm((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyRâ6s	

#cs¥|jjdƒsˆStˆtƒrYx-|jjdƒD]}ˆjjd|ƒq8WˆSg|jD]"}|djƒdkrc|^qc‰‡‡fd†}|SdS(søMerge the cookies that were set on this response with the
        given `resp` object (which can be any WSGI application).

        If the `resp` is a :class:`webob.Response` object, then the
        other object will be modified in-place.
        s
Set-Cookieis
set-cookiecs"d‡‡fd†}ˆ||ƒS(Ncsˆ||ˆd|ƒS(Ntexc_info((R8R¾Rò(t	c_headerststart_response(sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pytrepl_start_response\s(R2(tenvironRôRõ(Rótresp(RôsC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pytrepl_app[sN(R¾R¿RCR&RëtaddRORE(RMR÷RÂthRø((RóR÷sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt
merge_cookiesKs"cCs·|jjddƒ}|jdkrTtj|d|jddƒ|_||j_n|jj|kr°tj|ddƒ}|jjj	ƒ|jjj
|jƒ||j_n|jS(sž
        Get/set/modify the Cache-Control header (`HTTP spec section 14.9
        <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9>`_)
        s
cache-controlR-t
updates_toRƒtresponseN(R¾R¿t_cache_control_objR2Rtparset_update_cache_controltheader_valuet
propertiestcleartupdate(RMRZtnew_obj((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_cache_control__gethscCs¿|sd}nt|tƒr0t|dƒ}nt|tƒrNt|ƒ}nt|tƒr’|jdkr}||jd<dStj|dƒ}n|j	}|j
jƒ|j
j|j
ƒdS(NR-Rýs
Cache-Control(
RCtdictRR
RFRþR2R¾Rÿt
cache_controlRRR(RMRZtcache((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_cache_control__setys	
	
cCs
i|_dS(N(R(RM((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_cache_control__delŠscCsBt|ƒ}|s1d|jkr>|jd=q>n
||jd<dS(Ns
Cache-Control(RR¾(RMt	prop_dictRZ((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyRs
icKs/|tkrd}nt|tƒr3t|ƒ}n|j}|dkrKn³|sÃt|_t|_t|_d|_	d|_
d|_tj
ƒ|_d|jkr·tj
ƒ|_nd|_n;|jjƒ||_	tj
ƒtd|ƒ|_d|_x*|jƒD]\}}t|||ƒqWdS(sÔ
            Set expiration on this request.  This sets the response to
            expire in the given seconds, and any other attributes are used
            for cache_control (e.g., private=True, etc).
        is
last-modifiedsno-cachetsecondsN(R›RCRRRR2tno_storetno_cachetmust_revalidateRÜt
post_checkt	pre_checkRRäRåR¾t
last_modifiedtpragmaRRRIRL(RMR
RRRRYRZ((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_cache_expiress0								
		cCs|jS(N(R(RM((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt<lambda>ÁstgzipcCs­|dkstd|ƒ‚|dkr6|jƒdS|jdkrIdS|rmt|jƒ|_d|_n3tt|jƒƒ|_t	t
t|jƒƒ|_d|_dS(sl
        Encode the content with the given encoding (only gzip and
        identity are supported).
        tidentityRsUnknown encoding: %rN(sidentitysgzip(R’tdecode_contenttcontent_encodingt
gzip_app_iterRHRPR2RbRpR¬RwRG(RMRStlazy((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pytencode_contentÇs

c	CsØ|jpd}|dkrdS|dkr>td|ƒ‚n|dkr³ddlm}ddlm}|dd	d
dd||jƒƒ}|jƒ|_d|_|j	ƒn!t
j|jd
ƒ|_d|_dS(NRRtdeflates)I don't know how to decode the content %siÿÿÿÿ(tGzipFile(tBytesIOtfilenameR-tmodeRntfileobjiñÿÿÿ(sgzipsdeflate(RR`RRtioR RNRaR2tclosetzlibt
decompress(RMRRR tgzip_f((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyRÛs$	
cCs||dkr|j}nt|ƒjƒ}t|ƒ}|jddƒ}t|ƒ}|jdƒ|_|rx||_	ndS(sù
        Generate an etag for the response object using an MD5 hash of
        the body (the body parameter, or ``self.body`` if not given)

        Sets ``self.etag``
        If ``set_content_md5`` is True sets ``self.content_md5`` as well
        s
R-t=N(
R2RNRtdigestRRÖR	R]tetagR”(RMRNtset_content_md5t
md5_digest((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pytmd5_etagîscCs/tj|ƒr|Stjt|ƒ|ƒ}|S(N(RRÀRturljoint_request_uri(RöRZtnew_location((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_make_location_absolutescCsPg|jD]B\}}|jƒdkr4||fn||j||ƒf^q
S(Ntlocation(R:RER2(RMRöRWRX((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_abs_headerlistscCs\|jr|j||ƒS|j|ƒ}||j|ƒ|ddkrUt|jƒS|jS(s,
        WSGI application interface
        tREQUEST_METHODtHEAD(RAtconditional_response_appR4R8t
EmptyResponseRH(RMRöRôRO((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt__call__s	
tGETR6c
Csƒt|ƒ}|j|ƒ}|jddƒ}||jkr¹t}|jri|jri|j|jk}n'|jr|jr|j|jk}n|r¹|dt	|ƒƒt
|jƒSn|jrS||j
krS|jdkrS|dkrS|jdkrS|jdk	rS|jj|jƒ}|dkrµt|jƒtd|jƒ}dtt|ƒƒfdttdd|jƒƒfdgt	|ƒ}|d|ƒ|dkr®dS|gS|j|j|jƒ}	|	dk	rS|jdk	sît‚dt|j|jƒfdt|ƒfgt	|dƒ}|d
|ƒ|dkrLt
|	ƒS|	Sn||j|ƒ|dkr|t
|jƒS|jS(s%
        Like the normal __call__ interface, but checks conditional headers:

        * If-Modified-Since   (304 Not Modified; only on GET, HEAD)
        * If-None-Match       (304 Not Modified; only on GET, HEAD)
        * Range               (406 Partial Content; only on GET, HEAD)
        R5R:s304 Not ModifiedR6iÈs#Requested range not satisfiable: %ssContent-Lengths
Content-RangesContent-Types
text/plains#416 Requested Range Not Satisfiablescontent-lengths206 Partial ContentN(sHEADsGET(sContent-Types
text/plain((scontent-length(R"R4R¿t
_safe_methodsRœt
if_none_matchR+tif_modified_sinceRtfilter_headersR8RHtrangetif_ranget
content_rangeR2R€RbRqRRFRGRtapp_iter_rangeRÆtstopR’R8(
RMRöRôtreqROtmethodt	status304RARNRP((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyR7&s^




cCs8|j}t|dƒr(|j||ƒSt|||ƒS(s…
        Return a new app_iter built from the response app_iter, that
        serves up only the given ``start:stop`` range.
        RB(RHRJRBtAppIterRange(RMRÆRCRP((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyRBhs	N(sGETsHEAD(ƒRst
__module__t__doc__R<R=RŸRœR@RžR2trequestRöR;R[tclassmethodRoRrRvR|R}R…tpropertyR8R‡R‰R€t
status_intRŠR‹RŒRORŽRR¾R“R–RNR˜R™RšR)R(Rthas_bodyR¡R¢R£Rctunicode_bodytubodyR¥R¨R©t	body_fileR®R¯R°R±RPRtallowtvaryRRRR RbRtcontent_languagetcontent_locationR”tcontent_dispositiont
accept_rangesRRRARtdateRåRR¸RRR+R¹R3RRtageRRtretry_aftertserverRRtwww_authenticateRÄRÈRÅRDRÊRÌRËRQRÑRÙRÓtcontent_type_paramsRèRéR›RâRûRþRR
RRRRt
cache_expiresRRR.tstaticmethodR2R4R9R;R7RB(((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyR&Is
X›4													$						
	
												
		#						t
					$		
		Bscontent-lengthscontent-typecCs-g|D]"}|djƒ|kr|^qS(Ni(RE(thlisttremove_headersRú((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyR>ssiiccs/x(tr*|j|ƒ}|s"Pn|VqWdS(N(R›Ra(R§t
block_sizetdata((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyR¦ws
	R¤cBs_eZdZeZd„Zd„Zed„ddƒZd„Z	d„Z
d„Zd	„ZRS(
twbcCs||_|j|_dS(sH
        Represents a :class:`~Response` as a file like object.
        N(RýR®(RMRý((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyR[‚s	cCsd|jS(Ns<body_file for %r>(Rý(RM((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyRv‰scCs
|jjS(N(RýRD(RM((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyRsR†s:The encoding of the file (inherited from response.charset)cCs"x|D]}|j|ƒqWdS(s;
        Write a sequence of lines to the response
        N(R®(RMtseqtitem((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt
writelines‘s
cCstdƒ‚dS(Ns Response bodies cannot be closed(tNotImplementedError(RM((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyR%˜scCsdS(N((RM((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pytflush›scCs?|jjdkrdStg|jjD]}t|ƒ^q&ƒS(sR
        Provide the current location where we are going to start writing
        iN(RýRPR2R¬RG(RMR«((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyttellžs(
RsRHR"RœtclosedR[RvRLRSRgR%RiRj(((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyR¤~s							RGcBsAeZdZd„Zd„Zd„Zd„ZeZd„ZRS(s<
    Wraps an app_iter, returning just a range of bytes
    cCs~|dkstd|ƒ‚|dksP|dkr@||ksPtd|ƒ‚t|ƒ|_d|_||_||_dS(Nis
Bad start: %rsBad stop: %r(R’R2titerRPt_posRÆRC(RMRPRÆRC((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyR[­s'
		cCs|S(N((RM((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt__iter__¶scCsÑ|j|j}}x·|jD]£}|jt|ƒ7_|j|krMqq|j|kr`dS|||j}|dk	r¼|j|kr¼|||j }t|ƒ||ks¼t‚n|SqWtƒ‚dS(NR-(RÆRCRPRmRGR2R’t
StopIteration(RMRÆRCR«((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_skip_start¹scCsŸ|j|jkr|jƒS|j}|dk	rI|j|krIt‚nt|jƒ}|jt|ƒ7_|dksˆ|j|krŒ|S|||j SdS(N(	RmRÆRpRCR2RotnextRPRG(RMRCR«((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyRqÊs
		cCst|jƒdS(N(RqRP(RM((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyR%Üs(	RsRHRIR[RnRpRqt__next__R%(((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyRG¨s					R8cBs;eZdZdd„Zd„Zd„Zd„ZeZRS(s™An empty WSGI response.

    An iterator that immediately stops. Optionally provides a close
    method to close an underlying app_iter it replaces.
    cCs.|dk	r*t|dƒr*|j|_ndS(NR%(R2RJR%(RMRP((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyR[çscCs|S(N((RM((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyRnëscCsdS(Ni((RM((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt__len__îscCs
tƒ‚dS(N(Ro(RM((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyRqñsN(	RsRHRIR2R[RnRsRqRr(((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyR8às			cCsI|jdƒpH|jdƒr-|jdƒpH|jdƒoH|jdƒS(Nsapplication/xmlsapplication/s+xmlsimage/(R^tendswith(RQ((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt_is_xmlös
cCs|jdƒpt|ƒS(Nstext/(R^Ru(RQ((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyR>scCsJ|dd}|jdƒr.||d7}n||dd|d7}|jdƒrt|ddkrt|d	 }n,|jd
ƒr |ddkr |d }ntrßt|jd
dƒdƒ}t|jddƒdƒ}n$|jd
dƒ}|jddƒ}|t|ƒ7}t|ƒ}d
|kr<||d7}n
||7}|S(sZLike wsgiref.url.request_uri, except eliminates :80 ports

    Return the full request URIswsgi.url_schemes://t	HTTP_HOSTtSERVER_NAMER,tSERVER_PORTs:80thttpiýÿÿÿs:443thttpsiüÿÿÿtSCRIPT_NAMERÚslatin-1t	PATH_INFOR-i(R¿RtRRR(Röturltscript_namet	path_infot
qpath_info((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyR0	s&


cCs t|dƒr|jƒndS(NR%(RJR%(Rl((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyRq(sccsÍd}tjdƒd@}tjdtjtjtjdƒ}tVxQ|D]I}|t|ƒ7}tj||ƒd@}|j|ƒ}|rJ|VqJqJW|j	ƒ}|r±|Vnt
jd||d@ƒVdS(NiR-Iÿÿÿÿi	s<2L(R&tcrc32tcompressobjtDEFLATEDt	MAX_WBITSt
DEF_MEM_LEVELt_gzip_headerRGtcompressRitstructtpack(RPtsizetcrcR‡RfRÐ((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyR,s
cCsQt|ƒ}t|ƒdkr7|d d|d}ntd||fƒ‚dS(Ni2is...iöÿÿÿs>An item of the app_iter (%s) was text, causing a text body: %r(treprRGR6(RPRNt
app_iter_repr((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyR‘Ds(Ktbase64RRRthashlibRtreRˆR&t
simplejsonR)tImportErrortwebob.byterangeRtwebob.cachecontrolRRtwebob.compatRRR	R
RRt
webob.cookiesR
Rtwebob.datetime_utilsRRRtwebob.descriptorsRRRRRRRRRRRRRRR t
webob.headersR!t
webob.requestR"t
webob.utilR#R$R%t__all__tcompiletIRÍRÕR†tobjectR;R&R>R¦R¤RGR8RuR>R0RqRR‘(((sC/home/tvault/.virtenv/lib/python2.7/site-packages/webob/response.pyt<module>sP
.	d		ÿÿÿÿÿ/*8