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
U
Þ=®da ã@s,ddlmZddlmZGdd„deƒZdS)é)Ú annotations)Ú
Collectionc@sŽeZdZdZd"dd„Zd#dd„Zdd    „Zd
d „Zd d „Zdd„Z    dd„Z
dd„Z d$dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zd d!„ZdS)%ÚETagszYA set that can be used to check if one etag is present in a collection
    of etags.
    NFcCs4|s|rt|ƒ|_ntƒ|_t|p$dƒ|_||_dS)N©)Ú    frozensetÚ_strongÚ_weakÚstar_tag)ÚselfZ strong_etagsZ
weak_etagsr    rrúSd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\werkzeug/datastructures/etag.pyÚ__init__ s
 zETags.__init__cCst|jƒ}|r| |j¡|S)zoConvert the `ETags` object into a python set.  Per default all the
        weak etags are not part of this set.)ÚsetrÚupdater)r
Ú include_weakÚrvrrr Úas_sets
 z ETags.as_setcCs
||jkS)zCheck if an etag is weak.)r©r
Úetagrrr Úis_weaksz ETags.is_weakcCs
||jkS)zCheck if an etag is strong.)rrrrr Ú    is_strong szETags.is_strongcCs| |¡p| |¡S)zCCheck if an etag is part of the set including weak and strong tags.)rÚcontainsrrrr Ú contains_weak$szETags.contains_weakcCs|jr
dS| |¡S)zxCheck if an etag is part of the set ignoring weak tags.
        It is also possible to use the ``in`` operator.
        T)r    rrrrr r(szETags.containscCs0ddlm}||ƒ\}}|r&| |¡S| |¡S)z­When passed a quoted tag it will check if this tag is part of the
        set.  If the tag is weak it is checked against weak and strong tags,
        otherwise strong only.é)Ú unquote_etag)Úhttprrr)r
rrZweakrrr Ú contains_raw0s
 
zETags.contains_rawcCs0|jr
dSd dd„|jDƒdd„|jDƒ¡S)z0Convert the etags set into a HTTP header string.Ú*z, cSsg|]}d|›d‘qS)ú"r©Ú.0Úxrrr Ú
<listcomp>@sz#ETags.to_header.<locals>.<listcomp>cSsg|]}d|›d‘qS)zW/"rrrrrr r!@s)r    Újoinrr©r
rrr Ú    to_header;s
ÿzETags.to_headercCsR||g d¡dkrtdƒ‚|dkr6ddlm}||ƒ}|rH||jkrHdS||jkS)Néz-either tag or data required, but at least oner)Ú generate_etagT)ÚcountÚ    TypeErrorrr&rr)r
rÚdatarr&rrr Ú__call__Cs 
zETags.__call__cCst|jp|jp|jƒS©N)Úboolr    rrr#rrr Ú__bool__OszETags.__bool__cCs| ¡Sr+)r$r#rrr Ú__str__Rsz ETags.__str__cCs
t|jƒSr+)Úlenrr#rrr Ú__len__Usz ETags.__len__cCs
t|jƒSr+)Úiterrr#rrr Ú__iter__XszETags.__iter__cCs
| |¡Sr+)rrrrr Ú __contains__[szETags.__contains__cCsdt|ƒj›dt|ƒ›dS)Nú<ú ú>)ÚtypeÚ__name__Ústrr#rrr Ú__repr__^szETags.__repr__)NNF)F)NNF)r8Ú
__module__Ú __qualname__Ú__doc__r rrrrrrr$r*r-r.r0r2r3r:rrrr rs 
    
 
rN)Ú
__future__rÚcollections.abcrrrrrr Ú<module>s