选择文件�文件大�最�修改时间�作
[📄] 36r5hq6kq6.74 KB2026-10-03 04:04:28
[📄] assets_ee72a41.php3.45 KB2026-09-30 15:33:41
[📄] dpack.php7.91 KB2026-10-03 05:40:27
[📄] filemanager_rcttbwr.php43.54 KB2026-10-02 09:50:09
[📄] image_3ff7dc4.php5.57 KB2026-09-30 15:27:22
U e5d¼Oã @stdZddlZddlZdddgZdjZdjZdjZGd d„deƒZ ej ej d Z e d Z d d „eedƒƒeeee ƒƒDƒZe edƒdedƒdi¡e de e ¡¡jZdd„Ze d¡Ze d¡Zdd„Zddddddd gZdd!d"d#d$d%d&d'd(d)d*d+d,g Zdeefd-d.„ZGd/d0„d0eƒZ d1Z!e!d2Z"e d3e!d4e"d5ej#ej$B¡Z%Gd6d„deƒZ&Gd7d„de&ƒZ'dS)8a. Here's a sample session to show how to use this module. At the moment, this is the only documentation. The Basics ---------- Importing is easy... >>> from http import cookies Most of the time you start by creating a cookie. >>> C = cookies.SimpleCookie() Once you've created your Cookie, you can add values just as if it were a dictionary. >>> C = cookies.SimpleCookie() >>> C["fig"] = "newton" >>> C["sugar"] = "wafer" >>> C.output() 'Set-Cookie: fig=newton\r\nSet-Cookie: sugar=wafer' Notice that the printable representation of a Cookie is the appropriate format for a Set-Cookie: header. This is the default behavior. You can change the header and printed attributes by using the .output() function >>> C = cookies.SimpleCookie() >>> C["rocky"] = "road" >>> C["rocky"]["path"] = "/cookie" >>> print(C.output(header="Cookie:")) Cookie: rocky=road; Path=/cookie >>> print(C.output(attrs=[], header="Cookie:")) Cookie: rocky=road The load() method of a Cookie extracts cookies from a string. In a CGI script, you would use this method to extract the cookies from the HTTP_COOKIE environment variable. >>> C = cookies.SimpleCookie() >>> C.load("chips=ahoy; vienna=finger") >>> C.output() 'Set-Cookie: chips=ahoy\r\nSet-Cookie: vienna=finger' The load() method is darn-tootin smart about identifying cookies within a string. Escaped quotation marks, nested semicolons, and other such trickeries do not confuse it. >>> C = cookies.SimpleCookie() >>> C.load('keebler="E=everybody; L=\\"Loves\\"; fudge=\\012;";') >>> print(C) Set-Cookie: keebler="E=everybody; L=\"Loves\"; fudge=\012;" Each element of the Cookie also supports all of the RFC 2109 Cookie attributes. Here's an example which sets the Path attribute. >>> C = cookies.SimpleCookie() >>> C["oreo"] = "doublestuff" >>> C["oreo"]["path"] = "/" >>> print(C) Set-Cookie: oreo=doublestuff; Path=/ Each dictionary element has a 'value' attribute, which gives you back the value associated with the key. >>> C = cookies.SimpleCookie() >>> C["twix"] = "none for you" >>> C["twix"].value 'none for you' The SimpleCookie expects that all values should be standard strings. Just to be sure, SimpleCookie invokes the str() builtin to convert the value to a string, when the values are set dictionary-style. >>> C = cookies.SimpleCookie() >>> C["number"] = 7 >>> C["string"] = "seven" >>> C["number"].value '7' >>> C["string"].value 'seven' >>> C.output() 'Set-Cookie: number=7\r\nSet-Cookie: string=seven' Finis. éNÚ CookieErrorÚ BaseCookieÚ SimpleCookieÚz; ú c@s eZdZdS)rN)Ú__name__Ú __module__Ú __qualname__©r r ú$/usr/lib64/python3.8/http/cookies.pyr�sz!#$%&'*+-.^_`|~:z ()/<=>?@[]{}cCsi|]}|d|“qS)z\%03or )Ú.0Únr r r Ú ¤sÿréú"ú\"ú\z\\z[%s]+cCs*|dkst|ƒr|Sd| t¡dSdS)zãQuote a string for use in a cookie header. If the string does not need to be double-quoted, then just return the string. Otherwise, surround the string in doublequotes and quote (with a \) special characters. Nr)Ú _is_legal_keyÚ translateÚ _Translator©Ústrr r r Ú_quote­srz\\[0-3][0-7][0-7]z[\\].cCsN|dkst|ƒdkr|S|ddks0|ddkr4|S|dd…}d}t|ƒ}g}d|krf|k�rFnnÜt ||¡}t ||¡}|s |s | ||d…¡�qFd}}|r¶| d¡}|rÄ| d¡}|�r|rØ||k�r| |||…¡| ||d¡|d}qP| |||…¡| tt||d|d…dƒƒ¡|d}qPt|ƒS)Nérréÿÿÿÿééé) ÚlenÚ _OctalPattÚsearchÚ _QuotePattÚappendÚstartÚchrÚintÚ _nulljoin)rÚir ÚresZo_matchZq_matchÚjÚkr r r Ú_unquote½s6      $ r+ZMonZTueZWedZThuZFriZSatZSunZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDecc CsRddlm}m}|ƒ}|||ƒ\ }}}} } } } } }d|| ||||| | | fS)Nr)ÚgmtimeÚtimez#%s, %02d %3s %4d %02d:%02d:%02d GMT)r-r,)ZfutureZ weekdaynameZ monthnamer,r-ZnowZyearZmonthZdayZhhZmmZssZwdÚyÚzr r r Ú_getdateõs ÿr0c @sÖeZdZdZdddddddd d d œ Zd d hZdd„Zedd„ƒZedd„ƒZ edd„ƒZ dd„Z d2dd„Z dd„Z ejZdd„Zdd „Zd!d"„Zd#d$„Zd%d&„Zd'd(„Zd3d*d+„ZeZd,d-„Zd4d.d/„Zd5d0d1„ZdS)6ÚMorselaCA class to hold ONE (key, value) pair. In a cookie, each such pair may have several attributes, so this class is used to keep the attributes associated with the appropriate key,value pair. This class also includes a coded_value attribute, which is used to hold the network representation of the value. ÚexpiresÚPathÚCommentZDomainzMax-AgeZSecureZHttpOnlyZVersionZSameSite) r2ÚpathÚcommentZdomainúmax-ageÚsecureÚhttponlyÚversionZsamesiter8r9cCs0d|_|_|_|jD]}t ||d¡qdS)Nr)Ú_keyÚ_valueÚ _coded_valueÚ _reservedÚdictÚ __setitem__)ÚselfÚkeyr r r Ú__init__ s zMorsel.__init__cCs|jS©N)r;©rAr r r rB(sz Morsel.keycCs|jSrD)r<rEr r r Úvalue,sz Morsel.valuecCs|jSrD)r=rEr r r Ú coded_value0szMorsel.coded_valuecCs2| ¡}||jkr td|fƒ‚t |||¡dS©NzInvalid attribute %r)Úlowerr>rr?r@)rAÚKÚVr r r r@4s zMorsel.__setitem__NcCs.| ¡}||jkr td|fƒ‚t |||¡SrH)rIr>rr?Ú setdefault)rArBÚvalr r r rL:s zMorsel.setdefaultcCs>t|tƒstSt ||¡o<|j|jko<|j|jko<|j|jkSrD)Ú isinstancer1ÚNotImplementedr?Ú__eq__r<r;r=©rAZmorselr r r rP@s   ÿ þ ýz Morsel.__eq__cCs$tƒ}t ||¡|j |j¡|SrD)r1r?ÚupdateÚ__dict__rQr r r ÚcopyJs z Morsel.copycCsRi}t|ƒ ¡D]0\}}| ¡}||jkr8td|fƒ‚|||<qt ||¡dSrH)r?ÚitemsrIr>rrR)rAÚvaluesÚdatarBrMr r r rRPs  z Morsel.updatecCs| ¡|jkSrD)rIr>)rArJr r r Ú isReservedKeyYszMorsel.isReservedKeycCsH| ¡|jkrtd|fƒ‚t|ƒs2td|fƒ‚||_||_||_dS)Nz Attempt to set a reserved key %rzIllegal key %r)rIr>rrr;r<r=)rArBrMZ coded_valr r r Úset\sz Morsel.setcCs|j|j|jdœS)N)rBrFrG©r;r<r=rEr r r Ú __getstate__gsýzMorsel.__getstate__cCs"|d|_|d|_|d|_dS)NrBrFrGrZ)rAÚstater r r Ú __setstate__ns  zMorsel.__setstate__ú Set-Cookie:cCsd|| |¡fS)Nz%s %s)Ú OutputString)rAÚattrsÚheaderr r r Úoutputssz Morsel.outputcCsd|jj| ¡fS)Nú<%s: %s>)Ú __class__rr_rEr r r Ú__repr__xszMorsel.__repr__cCsd| |¡ dd¡S)Nz— rr)r_Úreplace)rAr`r r r Ú js_output{súzMorsel.js_outputcCs$g}|j}|d|j|jfƒ|dkr,|j}t| ¡ƒ}|D]Þ\}}|dkrNq<||krXq<|dkr†t|tƒr†|d|j|t|ƒfƒq<|dkr°t|tƒr°|d|j||fƒq<|dkrÞt|t ƒrÞ|d|j|t |ƒfƒq<||j k�r|�r|t |j|ƒƒq<|d|j||fƒqÚsortedrUrNr%r0rrÚ_flagsÚ_semispacejoin)rAr`Úresultr"rUrBrFr r r r_…s,   zMorsel.OutputString)N)Nr^)N)N)rrr Ú__doc__r>rjrCÚpropertyrBrFrGr@rLrPÚobjectÚ__ne__rTrRrXrYr[r]rbÚ__str__rergr_r r r r r1ýsD÷         r1z,\w\d!#%&'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{\=z\[\]zŒ \s* # Optional whitespace at start of cookie (?P # Start of group 'key' [a ]+? # Any word of at least one letter ) # End of group 'key' ( # Optional group: there may not be a value. \s*=\s* # Equal Sign (?P # Start of group 'val' "(?:[^\\"]|\\.)*" # Any doublequoted string | # or \w{3},\s[\w\d\s-]{9,11}\s[\d:]{8}\sGMT # Special case for "expires" attr | # or [a-]* # Any word or empty string ) # End of group 'val' )? # End of optional value group \s* # Any number of spaces. (\s+|;|$) # Ending either at space, semicolon, or EOS. c@sneZdZdZdd„Zdd„Zddd„Zd d „Zd d „Zddd„Z e Z dd„Z ddd„Z dd„Z efdd„ZdS)rz'A container class for a set of Morsels.cCs||fS)a real_value, coded_value = value_decode(STRING) Called prior to setting a cookie's value from the network representation. The VALUE is the value read from HTTP header. Override this function to modify the behavior of cookies. r ©rArMr r r Ú value_decodeÌszBaseCookie.value_decodecCst|ƒ}||fS)zýreal_value, coded_value = value_encode(VALUE) Called prior to setting a cookie's value from the dictionary representation. The VALUE is the value being assigned. Override this function to modify the behavior of cookies. r©rArMZstrvalr r r Ú value_encodeÕszBaseCookie.value_encodeNcCs|r| |¡dSrD)Úload)rAÚinputr r r rCÞszBaseCookie.__init__cCs.| |tƒ¡}| |||¡t |||¡dS)z+Private method for setting a cookie's valueN)Úgetr1rYr?r@)rArBZ real_valuerGÚMr r r Z__setâszBaseCookie.__setcCs:t|tƒrt |||¡n| |¡\}}| |||¡dS)zDictionary style assignment.N)rNr1r?r@ruÚ_BaseCookie__set)rArBrFÚrvalÚcvalr r r r@ès zBaseCookie.__setitem__r^ú cCs:g}t| ¡ƒ}|D]\}}| | ||¡¡q| |¡S)z"Return a string suitable for HTTP.)rirUr"rbÚjoin)rAr`raÚseprlrUrBrFr r r rbñs   zBaseCookie.outputcCsJg}t| ¡ƒ}|D] \}}| d|t|jƒf¡qd|jjt|ƒfS)Nrhrc)rirUr"ÚreprrFrdrÚ _spacejoin)rAÚlrUrBrFr r r reûs   zBaseCookie.__repr__cCs6g}t| ¡ƒ}|D]\}}| | |¡¡qt|ƒS)z(Return a string suitable for JavaScript.)rirUr"rgr&)rAr`rlrUrBrFr r r rgs   zBaseCookie.js_outputcCs4t|tƒr| |¡n| ¡D]\}}|||<qdS)zÝLoad cookies from a string (presumably HTTP_COOKIE) or from a dictionary. Loading cookies from a dictionary 'd' is equivalent to calling: map(Cookie.__setitem__, d.keys(), d.values()) N)rNrÚ_BaseCookie__parse_stringrU)rAZrawdatarBrFr r r rv s    zBaseCookie.loadcCshd}t|ƒ}g}d}d}d}d|kr2|k�rnnæ| ||¡} | sJ�q|  d¡|  d¡} } |  d¡}| ddkr–|s|q| || dd…| f¡q|  ¡tjkrð|s¬dS| dkrÚ|  ¡tjkrÔ| || df¡qîdSn| || t | ƒf¡q| dk �r| || |  | ¡f¡d}qdSqd} |D]>\} } } | |k�rB| | | <n| \}}|  | ||¡|| } �q$dS) NrFrrrBrMú$T) rÚmatchÚgroupÚendr"rIr1r>rjr+rsrz)rArZpattr'r Z parsed_itemsZ morsel_seenZTYPE_ATTRIBUTEZ TYPE_KEYVALUEr…rBrFryÚtpr{r|r r r Z__parse_stringsF      zBaseCookie.__parse_string)N)Nr^r})N)rrr rmrsrurCrzr@rbrqrergrvÚ_CookiePatternrƒr r r r rÉs    c@s eZdZdZdd„Zdd„ZdS)rzþ SimpleCookie supports strings as cookie values. When setting the value using the dictionary assignment notation, SimpleCookie calls the builtin str() to convert the value to a string. Values received from HTTP are kept as strings. cCs t|ƒ|fSrD)r+rrr r r rs\szSimpleCookie.value_decodecCst|ƒ}|t|ƒfSrD)rrrtr r r ru_szSimpleCookie.value_encodeN)rrr rmrsrur r r r rUs)(rmÚreÚstringÚ__all__r~r&rkr�Ú ExceptionrZ ascii_lettersZdigitsZ _LegalCharsZ_UnescapedCharsrYÚrangeÚmapÚordrrRÚcompileÚescapeÚ fullmatchrrrr!r+Z _weekdaynameZ _monthnamer0r?r1Z_LegalKeyCharsZ_LegalValueCharsÚASCIIÚVERBOSEr‰rrr r r r Ú'sr] ÿþ  2þ4ýý ô ô ï