4V=j2ddlmZddlZddlZddlmZddlmZddlm Z ddlm Z ddlm Z dd lm Z dd lm Z ejd Z d)d*dZejdejejzZejdZd+d"Z d,d-d'Zdd(lmZdS).) annotationsN)datetime) _dt_as_utc) generate_etag) parse_date) parse_etags)parse_if_range_header) unquote_etagz&([Ww]/)?(?:"(.*?)"|(.*?))(?:\s*,\s*|$)T http_range str | None http_if_rangehttp_if_modified_sincehttp_if_none_match http_if_matchetagdata bytes | None last_modifieddatetime | str | Noneignore_if_rangeboolreturnc ||t|}n|tdd} t|trt |}|#t |d}d} |s|t|} | | j| j} nt |} | r |r|| krd} |rt|\}} | /| j (t| j  |} nMt|} | 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 isinstancestrrrreplacer dater rr contains contains_weak is_strong)r rrrrrrrr unmodifiedif_rangemodified_since_ if_none_matchif_matchs BC:\PYTHON\_runtimes\venv\Lib\site-packages\werkzeug/sansio/http.pyis_resource_modifiedr+s6 |(T"" 2333J-%%2"=11  "=#8#8Q#8#G#GHH H 8z5)77 9*2-#$:;;-M^,K,K  :t$$a  HM$=$X]33<> #=11H :!)!3!3D!9!99 >zr ([^=;]*) (?:\s*=\s* ( "(?:[^\\"]|\\.)*" | .*? ) )? \s*;\s* )flagss\\([0-3][0-7]{2}|.)mt.Match[bytes]bytesc|d}t|dkr|St|dddS)Nbig)grouplenintto_bytes)r.vs r*_cookie_unslash_replacer:qsC  A 1vv{{ q!99  a ' ''r,cookiecls#type[ds.MultiDict[str, str]] | Noneds.MultiDict[str, str]c>|tjdtj}|s |S|d}g}t|D]\}}|}|}|s0t|dkrj|d|dcxkrdkrQnnNt t|dd  d }| ||f||S) a)Parse 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:: 3.0 Passing bytes, and the ``charset`` and ``errors`` parameters, were removed. .. versionadded:: 2.2 Nztype[ds.MultiDict[str, str]];rr"r2r)errors)tcastds MultiDict _cookie_refindallstripr6_cookie_unslash_resubr:encodedecodeappend)r;r<outckcvs r* parse_cookierSzs$( {f3R\BB suu \\\F C$$V,,  B XXZZ XXZZ   r77a<) __future__rretypingrDr _internalrhttprrr r r compile_etag_rer+ASCIIVERBOSErHrKr:rSrTrFr,r*r`s"""""" """""" (((((( 2:? @ @" $)-%) $+/ LLLLL^RZ  (RZ      RZ 788((((/3,,,,,`$#######r,