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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
U
Þ=®d›ã@spddlmZddlmZddlmZdd„ZGdd„deeƒZGd    d
„d
eeƒZGd d „d eƒZ    d dl
m Z dS)é)Ú annotationsé)ÚImmutableDictMixin)ÚUpdateDictMixincs2t‡‡‡fdd„‡‡fdd„‡fdd„dˆ›ƒS)zÆReturn a new property object for a cache header. Useful if you
    want to add support for a cache extension in a subclass.
 
    .. versionchanged:: 2.0
        Renamed from ``cache_property``.
    cs| ˆˆˆ¡S©N)Ú_get_cache_value©Úx©ÚemptyÚkeyÚtype©ú\d:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\werkzeug/datastructures/cache_control.pyÚ<lambda>óz(cache_control_property.<locals>.<lambda>cs| ˆ|ˆ¡Sr)Ú_set_cache_value)r    Úv)r r rrrrcs
| ˆ¡Sr)Ú_del_cache_valuer)r rrrrz accessor for )Úproperty)r r r rr
rÚcache_control_propertys  
ürc@s‚eZdZdZedddƒZeddeƒZeddeƒZ    edddƒZ
dd
d „Z d d „Z dd„Z dd„Zdd„Zdd„Zdd„ZeeƒZdS)Ú _CacheControlaÒSubclass of a dict that stores values for a Cache-Control header.  It
    has accessors for all the cache-control directives specified in RFC 2616.
    The class does not differentiate between request and response directives.
 
    Because the cache-control directives in the HTTP header use dashes the
    python descriptors use underscores for that.
 
    To get a header of the :class:`CacheControl` object again you can convert
    the object into a string or call the :meth:`to_header` method.  If you plan
    to subclass it and add your own items have a look at the sourcecode for
    that class.
 
    .. versionchanged:: 2.1.0
        Setting int properties such as ``max_age`` will convert the
        value to an int.
 
    .. versionchanged:: 0.4
 
       Setting `no_cache` or `private` to boolean `True` will set the implicit
       none-value which is ``*``:
 
       >>> cc = ResponseCacheControl()
       >>> cc.no_cache = True
       >>> cc
       <ResponseCacheControl 'no-cache'>
       >>> cc.no_cache
       '*'
       >>> cc.no_cache = None
       >>> cc
       <ResponseCacheControl ''>
 
       In versions before 0.5 the behavior documented here affected the now
       no longer existing `CacheControl` class.
    zno-cacheÚ*Nzno-storezmax-ageéÿÿÿÿz no-transformrcCs$t ||p d¡||_|dk    |_dS)Nr)ÚdictÚ__init__Ú    on_updateÚprovided)ÚselfÚvaluesrrrrr?sz_CacheControl.__init__cCs^|tkr||kS||krZ||}|dkr,|S|dk    rVz ||ƒ}Wntk
rTYnX|SdS©ú+Used internally by the accessor properties.N)ÚboolÚ
ValueError)rr r r ÚvaluerrrrDs z_CacheControl._get_cache_valuecCsn|tkr$|rd||<qj| |d¡nF|dkr:| |d¡n0|dkrLd||<n|dk    rb||ƒ||<n|||<dS)r!NT)r"Úpop)rr r$r rrrrTs
 
z_CacheControl._set_cache_valuecCs||kr||=dSr r)rr rrrrfsz_CacheControl._del_cache_valuecCs
t |¡S)z6Convert the stored values into a cache control header.)ÚhttpZ dump_header©rrrrÚ    to_headerksz_CacheControl.to_headercCs| ¡Sr)r(r'rrrÚ__str__osz_CacheControl.__str__cCs4d dd„t| ¡ƒDƒ¡}dt|ƒj›d|›dS)Nú css |]\}}|›d|›VqdS)ú=Nr)Ú.0ÚkrrrrÚ    <genexpr>ssz)_CacheControl.__repr__.<locals>.<genexpr>ú<ú>)ÚjoinÚsortedÚitemsr Ú__name__)rZkv_strrrrÚ__repr__rsz_CacheControl.__repr__)rN)r4Ú
__module__Ú __qualname__Ú__doc__rÚno_cacher"Úno_storeÚintZmax_ageZ no_transformrrrrr(r)r5Ú staticmethodZcache_propertyrrrrrs#    
rc@s4eZdZdZeddeƒZeddeƒZeddeƒZ    dS)ÚRequestCacheControla…A cache control for requests.  This is immutable and gives access
    to all the request-relevant cache control headers.
 
    To get a header of the :class:`RequestCacheControl` object again you can
    convert the object into a string or call the :meth:`to_header` method.  If
    you plan to subclass it and add your own items have a look at the sourcecode
    for that class.
 
    .. versionchanged:: 2.1.0
        Setting int properties such as ``max_age`` will convert the
        value to an int.
 
    .. versionadded:: 0.5
       In previous versions a `CacheControl` class existed that was used
       both for request and response.
    z    max-stalerz    min-freshzonly-if-cachedN)
r4r6r7r8rr;Z    max_staleÚ    min_freshr"Zonly_if_cachedrrrrr=ys  r=c@sXeZdZdZeddeƒZedddƒZeddeƒZeddeƒZ    edde
ƒZ ed    deƒZ dS)
ÚResponseCacheControlaøA cache control for responses.  Unlike :class:`RequestCacheControl`
    this is mutable and gives access to response-relevant cache control
    headers.
 
    To get a header of the :class:`ResponseCacheControl` object again you can
    convert the object into a string or call the :meth:`to_header` method.  If
    you plan to subclass it and add your own items have a look at the sourcecode
    for that class.
 
    .. versionchanged:: 2.1.1
        ``s_maxage`` converts the value to an int.
 
    .. versionchanged:: 2.1.0
        Setting int properties such as ``max_age`` will convert the
        value to an int.
 
    .. versionadded:: 0.5
       In previous versions a `CacheControl` class existed that was used
       both for request and response.
    ÚpublicNÚprivaterzmust-revalidatezproxy-revalidatezs-maxageÚ    immutable) r4r6r7r8rr"r@rAZmust_revalidateZproxy_revalidater;Zs_maxagerBrrrrr?s     r?é)r&N) Ú
__future__rZmixinsrrrrrr=r?Úr&rrrrÚ<module>s   c