//usr/lib64/lib64//lib64/lib64//ó
ÛœSec @ s] d Z d d l m Z m Z d d l Z e j d ƒ Z d d d „ Z d d d „ ƒ YZ d S(
sÓ Manage HTTP Response Headers
Much of this module is red-handedly pilfered from email.message in the stdlib,
so portions are Copyright (C) 2001,2002 Python Software Foundation, and were
written by Barry Warsaw.
iÿÿÿÿ( t ListTypet TupleTypeNs [ \(\)<>@,;:\\"/\[\]\?=]i c C sx | d k rp t | ƒ d k rp | s3 t j | ƒ r_ | j d d ƒ j d d ƒ } d | | f Sd | | f Sn | Sd S( s~ Convenience function to format and return a key=value pair.
This will quote the value if needed or if quote is true.
i s \s \\t "s \"s %s="%s"s %s=%sN( t Nonet lent tspecialst searcht replace( t paramt valuet quote( ( s' /usr/lib64/python2.7/wsgiref/headers.pyt _formatparam s t Headersc B sž e Z d Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z e Z d „ Z
d d „ Z d „ Z
d
„ Z d „ Z d „ Z d
„ Z d „ Z d „ Z RS( s, Manage a collection of HTTP response headersc C s. t | ƒ t k r! t d ƒ ‚ n | | _ d S( Ns+ Headers must be a list of name/value tuples( t typeR t TypeErrort _headers( t selft headers( ( s' /usr/lib64/python2.7/wsgiref/headers.pyt __init__" s c C s
t | j ƒ S( s9 Return the total number of headers, including duplicates.( R R ( R ( ( s' /usr/lib64/python2.7/wsgiref/headers.pyt __len__' s c C s! | | =| j j | | f ƒ d S( s Set the value of a header.N( R t append( R t namet val( ( s' /usr/lib64/python2.7/wsgiref/headers.pyt __setitem__+ s c C sF | j ƒ } g | j D]" } | d j ƒ | k r | ^ q | j (d S( sy Delete all occurrences of a header, if present.
Does *not* raise an exception if the header is missing.
i N( t lowerR ( R R t kv( ( s' /usr/lib64/python2.7/wsgiref/headers.pyt __delitem__0 s c C s
| j | ƒ S( sH Get the first header value for 'name'
Return None if the header is missing instead of raising an exception.
Note that if the header appeared multiple times, the first exactly which
occurrance gets returned is undefined. Use getall() to get all
the values matching a header field name.
( t get( R R ( ( s' /usr/lib64/python2.7/wsgiref/headers.pyt __getitem__8 s c C s | j | ƒ d k S( s/ Return true if the message contains the header.N( R R ( R R ( ( s' /usr/lib64/python2.7/wsgiref/headers.pyt has_keyC s c C s@ | j ƒ } g | j D]&