zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
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
U
Þ=®dZã @süddlmZddlZddlZddlZddlmZddlmZddl    m
Z
ddl    m Z ddl    m Z dd    l    m Z dd
l    mZe d ¡Zd"d d d d d d dddddœ
dd„ZejdejejBdZe d¡Zdddœdd„Zd#d d d dddœdd „Zdd!lmZdS)$é)Ú annotationsN)Údatetimeé)Ú
_dt_as_utc)Ú generate_etag)Ú
parse_date)Ú parse_etags)Úparse_if_range_header)Ú unquote_etagz&([Ww]/)?(?:"(.*?)"|(.*?))(?:\s*,\s*|$)Tz
str | Nonez bytes | Nonezdatetime | str | NoneÚbool)
Ú
http_rangeÚ http_if_rangeÚhttp_if_modified_sinceÚhttp_if_none_matchÚ http_if_matchÚetagÚdataÚ last_modifiedÚignore_if_rangeÚreturnc    Cs|dkr|dk    rt|ƒ}n|dk    r*tdƒ‚d}    t|tƒr@t|ƒ}|dk    rXt|jddƒ}d}
|sp|dk    rpt|ƒ}
|
dk    rŠ|
jdk    rŠ|
j} nt|ƒ} | r¦|r¦|| kr¦d}    |rt    |ƒ\}} t
  t|¡}|
dk    rè|
j dk    rèt |
j ƒ |¡}    n0t |ƒ} | rþ|  |¡}    t |ƒ}|r| |¡ }    |     S)aConvenience method for conditional requests.
    :param http_range: Range HTTP header
    :param http_if_range: If-Range HTTP header
    :param http_if_modified_since: If-Modified-Since HTTP header
    :param http_if_none_match: If-None-Match HTTP header
    :param http_if_match: If-Match HTTP header
    :param etag: the etag for the response for comparison.
    :param data: or alternatively the data of the response to automatically
                 generate an etag using :func:`generate_etag`.
    :param last_modified: an optional date of the last modification.
    :param ignore_if_range: If `False`, `If-Range` header will be taken into
                            account.
    :return: `True` if the resource was modified, otherwise `False`.
 
    .. versionadded:: 2.2
    Nzboth data and etag givenFr)Ú microsecondT)rÚ    TypeErrorÚ
isinstanceÚstrrrÚreplacer    Údater
ÚtÚcastrrÚcontainsZ contains_weakZ    is_strong)r r rrrrrrrZ
unmodifiedZif_rangeZmodified_sinceÚ_Z if_none_matchZif_match©r úKd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\werkzeug/sansio/http.pyÚis_resource_modifieds:
 
 
 r"zr
    ([^=;]*)
    (?:\s*=\s*
      (
        "(?:[^\\"]|\\.)*"
      |
        .*?
      )
    )?
    \s*;\s*
    )Úflagss\\([0-3][0-7]{2}|.)zt.Match[bytes]Úbytes)ÚmrcCs,| d¡}t|ƒdkr|St|dƒ dd¡S)NééÚbig)ÚgroupÚlenÚintÚto_bytes)r%Úvr r r!Ú_cookie_unslash_replacess
 r.ztype[ds.MultiDict] | Nonezds.MultiDict[str, str])ÚcookieÚcharsetÚerrorsÚclsrcCs|dkrtj}t|tƒr0tjdtdd| ¡}|dk    rJtjdtddnd}|dk    rhtjdtddnd}|sv|ƒS|›d    }g}t     |¡D]x\}}| 
¡}| 
¡}|s¬qŽt |ƒdkrø|d
|d krÔd krønn t   t|d d … ¡¡ ||¡}| ||f¡qŽ||ƒS)aWParse a cookie from a string.
 
    The same key can be provided multiple times, the values are stored
    in-order. The default :class:`MultiDict` will have the first value
    first, and all values can be retrieved with
    :meth:`MultiDict.getlist`.
 
    :param cookie: The cookie header as a string.
    :param cls: A dict-like class to store the parsed cookies in.
        Defaults to :class:`MultiDict`.
 
    .. versionchanged:: 2.3
        Passing bytes, and the ``charset`` and ``errors`` parameters, are deprecated and
        will be removed in Werkzeug 3.0.
 
    .. versionadded:: 2.2
    NzoThe 'cookie' parameter must be a string. Passing bytes is deprecated and will not be supported in Werkzeug 3.0.r)Ú
stacklevelzIThe 'charset' parameter is deprecated and will be removed in Werkzeug 3.0zutf-8zHThe 'errors' parameter is deprecated and will be removed in Werkzeug 3.0rú;réÿÿÿÿú"r&)ÚdsZ    MultiDictrr$ÚwarningsÚwarnÚDeprecationWarningÚdecodeÚ
_cookie_reÚfindallÚstripr*Ú_cookie_unslash_reÚsubr.ÚencodeÚappend)r/r0r1r2ÚoutZckZcvr r r!Ú parse_cookie|sT
üýý
,ÿþrD)Údatastructures)    NNNNNNNNT)NNNN)Ú
__future__rÚreÚtypingrr8rÚ    _internalrÚhttprrrr    r
ÚcompileZ_etag_rer"ÚASCIIÚVERBOSEr<r?r.rDÚrEr7r r r r!Ú<module>sB        
÷"P
ô
 
üN