tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
X\¬Qc@s]dZddlmZmZddlZejdƒZddd„Zdd    d„ƒYZ    dS(
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ÿÿÿÿ(tListTypet    TupleTypeNs[ \(\)<>@,;:\\"/\[\]\?=]icCsx|dk    rpt|ƒdkrp|s3tj|ƒr_|jddƒjddƒ}d||fSd||fSn|SdS(    s~Convenience function to format and return a key=value pair.
 
    This will quote the value if needed or if quote is true.
    is\s\\t"s\"s%s="%s"s%s=%sN(tNonetlent    tspecialstsearchtreplace(tparamtvaluetquote((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/wsgiref/headers.pyt _formatparams tHeaderscBsžeZdZd„Zd„Zd„Zd„Zd„Zd„ZeZ    d„Z
dd„Z d    „Z d
„Zd „Zd „Zd „Zd„Zd„ZRS(s,Manage a collection of HTTP response headerscCs.t|ƒtk    r!tdƒ‚n||_dS(Ns+Headers must be a list of name/value tuples(ttypeRt    TypeErrort_headers(tselftheaders((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/wsgiref/headers.pyt__init__"scCs t|jƒS(s9Return the total number of headers, including duplicates.(RR(R((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/wsgiref/headers.pyt__len__'scCs!||=|jj||fƒdS(sSet the value of a header.N(Rtappend(Rtnametval((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/wsgiref/headers.pyt __setitem__+scCsF|jƒ}g|jD]"}|djƒ|kr|^q|j(dS(syDelete all occurrences of a header, if present.
 
        Does *not* raise an exception if the header is missing.
        iN(tlowerR(RRtkv((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/wsgiref/headers.pyt __delitem__0s cCs |j|ƒS(sHGet 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.
        (tget(RR((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/wsgiref/headers.pyt __getitem__8s    cCs|j|ƒdk    S(s/Return true if the message contains the header.N(RR(RR((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/wsgiref/headers.pythas_keyCscCs@|jƒ}g|jD]&}|djƒ|kr|d^qS(sqReturn a list of all the values for the named field.
 
        These will be sorted in the order they appeared in the original header
        list or were added to this instance, and may contain duplicates.  Any
        fields deleted and re-inserted are always appended to the header list.
        If no fields exist with the given name, returns an empty list.
        ii(RR(RRR((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/wsgiref/headers.pytget_allJs cCs@|jƒ}x-|jD]"\}}|jƒ|kr|SqW|S(s:Get the first header value for 'name', or return 'default'(RR(RRtdefaulttktv((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/wsgiref/headers.pyRVs
 cCs g|jD]\}}|^q
S(s*Return a list of all the header field names.
 
        These will be sorted in the order they appeared in the original header
        list, or were added to this instance, and may contain duplicates.
        Any fields deleted and re-inserted are always appended to the header
        list.
        (R(RR R!((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/wsgiref/headers.pytkeys_scCs g|jD]\}}|^q
S(s!Return a list of all header values.
 
        These will be sorted in the order they appeared in the original header
        list, or were added to this instance, and may contain duplicates.
        Any fields deleted and re-inserted are always appended to the header
        list.
        (R(RR R!((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/wsgiref/headers.pytvaluesiscCs|jS(sGet all the header fields and values.
 
        These will be sorted in the order they were in the original header
        list, or were added to this instance, and may contain duplicates.
        Any fields deleted and re-inserted are always appended to the header
        list.
        (R(R((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/wsgiref/headers.pytitemssscCs d|jS(Ns Headers(%r)(R(R((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/wsgiref/headers.pyt__repr__}scCs1djg|jD]}d|^qddgƒS(skstr() returns the formatted headers, complete with end line,
        suitable for direct HTTP transmission.s
s%s: %st(tjoinR(RR((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/wsgiref/headers.pyt__str__€scCs=|j|ƒ}|dkr5|jj||fƒ|S|SdS(s£Return first matching header value for 'name', or 'value'
 
        If there is no header named 'name', add a new header with name 'name'
        and value 'value'.N(RRRR(RRR    tresult((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/wsgiref/headers.pyt
setdefault…s
 cKs¬g}|dk    r"|j|ƒnxd|jƒD]V\}}|dkrc|j|jddƒƒq/|jt|jddƒ|ƒƒq/W|jj|dj|ƒfƒdS(sfExtended header setting.
 
        _name is the header field to add.  keyword arguments can be used to set
        additional parameters for the header field, with underscores converted
        to dashes.  Normally the parameter will be added as key="value" unless
        value is None, in which case only the key will be added.
 
        Example:
 
        h.add_header('content-disposition', 'attachment', filename='bud.gif')
 
        Note that unlike the corresponding 'email.message' method, this does
        *not* handle '(charset, language, value)' tuples: all values must be
        strings or None.
        t_t-s; N(RRR$RR RR'(Rt_namet_valuet_paramstpartsR R!((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/wsgiref/headers.pyt
add_header‘s  &N(t__name__t
__module__t__doc__RRRRRRt __contains__RRRR"R#R$R%R(R*R1(((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/wsgiref/headers.pyR s"                                    
   
   
            ((
R4ttypesRRtretcompileRRR R (((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/wsgiref/headers.pyt<module>s