HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/lib/python3.5/http/__pycache__/cookies.cpython-35.pyc


Fa>S
@sdZddlZddlZdddgZdjZdjZdjZd	d
ZGddde	Z
ejejdZ
e
d
ZddeedeeeeDZejeddeddiejdeje
jZddZejdZejdZddZddddd d!d"gZdd#d$d%d&d'd(d)d*d+d,d-d.g
Zdeed/d0ZGd1d2d2e Z!d3Z"e"d4Z#ejd5e"d6e#d7ej$Z%Gd8dde Z&Gd9dde&Z'dS):a.

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.
NCookieError
BaseCookieSimpleCookiez;  cCs0ddl}d|}|j|tdddS)NrzvThe .%s setter is deprecated. The attribute will be read-only in future releases. Please use the set() method instead.
stacklevel)warningswarnDeprecationWarning)setterr	msgr"/usr/lib/python3.5/http/cookies.py_warn_deprecated_settersrc@seZdZdS)rN)__name__
__module____qualname__rrrrrsz!#$%&'*+-.^_`|~:z
 ()/<=>?@[]{}cCsi|]}d||qS)z\%03or).0nrrr
<dictcomp>s	r"z\"\z\\z[%s]+cCs5|dkst|r|Sd|jtdSdS)zQuote 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)strrrr_quotesrz\\[0-3][0-7][0-7]z[\\].cCs|dkst|dkr"|S|ddksB|ddkrF|S|dd}d}t|}g}x?d|ko|knrtj||}tj||}|r|r|j||dPd	}}|r|jd}|r|jd}|r]|s$||kr]|j||||j||d|d}qq|j||||jtt||d|dd|d}qqWt|S)
Nrrr#r#)	len
_OctalPattsearch
_QuotePattappendstartchrint	_nulljoin)rirZresZo_matchZq_matchjkrrr_unquotes6 

.r0ZMonZTueZWedZThuZFriZSatZSunZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDecc	Csoddlm}m}|}|||\	}}}}	}
}}}
}d|||||||	|
|fS)Nr)gmtimetimez#%s, %02d %3s %4d %02d:%02d:%02d GMT)r2r1)ZfutureZweekdaynameZ	monthnamer1r2ZnowZyearZmonthZdayZhhZmmZssZwdyzrrr_getdates
	+r5c@seZdZdZddddddddd	d
ddd
dddiZdd
hZddZeddZej	ddZeddZ
e
j	ddZ
eddZej	ddZddZddd Z
d!d"ZejZd#d$Zd%d&Zd'd(Zed)d*Zd+d,Zd-d.Zdd/d0d1ZeZd2d3Zdd4d5Zdd6d7ZdS)8MorselaA 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.  This is most useful when Python
    objects are pickled for network transit.
    expirespathZPathZcommentCommentZdomainZDomainzmax-agezMax-AgeZsecureZSecureZhttponlyZHttpOnlyversionZVersioncCsBd|_|_|_x$|jD]}tj||dq!WdS)Nr)_key_value_coded_value	_reserveddict__setitem__)selfkeyrrr__init__&szMorsel.__init__cCs|jS)N)r;)rArrrrB.sz
Morsel.keycCstd||_dS)NrB)rr;)rArBrrrrB2s
cCs|jS)N)r<)rArrrvalue7szMorsel.valuecCstd||_dS)NrD)rr<)rArDrrrrD;s
cCs|jS)N)r=)rArrrcoded_value@szMorsel.coded_valuecCstd||_dS)NrE)rr=)rArErrrrEDs
cCsE|j}||jkr.td|ftj|||dS)NzInvalid attribute %r)lowerr>rr?r@)rAKVrrrr@IszMorsel.__setitem__NcCsA|j}||jkr.td|ftj|||S)NzInvalid attribute %r)rFr>rr?
setdefault)rArBvalrrrrIOszMorsel.setdefaultcCsYt|tstStj||oX|j|jkoX|j|jkoX|j|jkS)N)
isinstancer6NotImplementedr?__eq__r<r;r=)rAmorselrrrrMUsz
Morsel.__eq__cCs0t}tj|||jj|j|S)N)r6r?update__dict__)rArNrrrcopy_s	zMorsel.copycCsui}xXt|jD]D\}}|j}||jkrStd|f|||<qWtj||dS)NzInvalid attribute %r)r?itemsrFr>rrO)rAvaluesdatarBrJrrrrOesz
Morsel.updatecCs|j|jkS)N)rFr>)rArGrrr
isReservedKeynszMorsel.isReservedKeycCs|tkr.ddl}|jdtdd|j|jkrVtd|ft|sutd|f||_||_	||_
dS)NrzSLegalChars parameter is deprecated, ignored and will be removed in future versions.rrz Attempt to set a reserved key %rzIllegal key %r)_LegalCharsr	r
rrFr>rrr;r<r=)rArBrJZ	coded_valZ
LegalCharsr	rrrsetqs		z
Morsel.setcCsd|jd|jd|jiS)NrBrDrE)r;r<r=)rArrr__getstate__s		zMorsel.__getstate__cCs+|d|_|d|_|d|_dS)NrBrDrE)r;r<r=)rAstaterrr__setstate__s

zMorsel.__setstate__zSet-Cookie:cCsd||j|fS)Nz%s %s)OutputString)rAattrsheaderrrroutputsz
Morsel.outputcCsd|jj|jfS)Nz<%s: %s>)	__class__rr[)rArrr__repr__szMorsel.__repr__cCsd|j|jddS)Nz
        <script type="text/javascript">
        <!-- begin hiding
        document.cookie = "%s";
        // end hiding -->
        </script>
        rz\")r[replace)rAr\rrr	js_outputszMorsel.js_outputcCsQg}|j}|d|j|jf|dkr>|j}t|j}x|D]\}}|dkrrqW||krqW|dkrt|tr|d|j|t|fqW|dkrt|tr|d|j||fqW||j	kr(|rC|t
|j|qW|d|j||fqWWt|S)Nz%s=%srr7zmax-agez%s=%d)r(rBrEr>sortedrRrKr+r5_flagsr_semispacejoin)rAr\resultr(rRrBrDrrrr[s(		$zMorsel.OutputString)rrr__doc__r>rdrCpropertyrBrrDrEr@rIrMobject__ne__rQrOrUrVrWrXrZr^__str__r`rbr[rrrrr6s@		
r6z,\w\d!#%&'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{\=z\[\]z
    (?x)                           # This is a verbose pattern
    \s*                            # Optional whitespace at start of cookie
    (?P<key>                       # 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<val>                         # 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@seZdZdZddZddZdddZd	d
ZddZdd
dddZ	e	Z
ddZdddZddZ
eddZdS)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)rArJrrrvalue_decodeszBaseCookie.value_decodecCst|}||fS)zreal_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)rArJstrvalrrrvalue_encodeszBaseCookie.value_encodeNcCs|r|j|dS)N)load)rAinputrrrrCszBaseCookie.__init__cCs?|j|t}|j|||tj|||dS)z+Private method for setting a cookie's valueN)getr6rWr?r@)rArBZ
real_valuerEMrrrZ__setszBaseCookie.__setcCsQt|tr%tj|||n(|j|\}}|j|||dS)zDictionary style assignment.N)rKr6r?r@rn_BaseCookie__set)rArBrDrvalcvalrrrr@szBaseCookie.__setitem__zSet-Cookie:z
cCsUg}t|j}x-|D]%\}}|j|j||qW|j|S)z"Return a string suitable for HTTP.)rcrRr(r^join)rAr\r]seprfrRrBrDrrrr^s
zBaseCookie.outputcCsig}t|j}x4|D],\}}|jd|t|jfqWd|jjt|fS)Nz%s=%sz<%s: %s>)rcrRr(reprrDr_r
_spacejoin)rAlrRrBrDrrrr`s
$zBaseCookie.__repr__cCsOg}t|j}x*|D]"\}}|j|j|qWt|S)z(Return a string suitable for JavaScript.)rcrRr(rbr,)rAr\rfrRrBrDrrrrbs
zBaseCookie.js_outputcCsJt|tr|j|n'x$|jD]\}}|||<q,WdS)zLoad 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)rKr_BaseCookie__parse_stringrR)rAZrawdatarBrDrrrro%s
zBaseCookie.loadcCsd}t|}g}d}d}d}xZd|koD|knr|j||}	|	sbP|	jd|	jd}
}|	jd}|
ddkr|sq-|j||
dd|fq-|
jtjkrK|sdS|dkr,|
jtjkr%|j||
dfqHdSq|j||
t	|fq-|dk	r|j||
|j
|fd}q-dSq-Wd}x}|D]u\}
}
}|
|kr|dk	st|||
<q|
|kst|\}}|j|
||||
}qWdS)	NrFr rrBrJ$T)
r$matchgroupendr(rFr6r>rdr0rlAssertionErrorrs)rArZpattr-rZparsed_itemsZmorsel_seenZTYPE_ATTRIBUTEZ
TYPE_KEYVALUEr}rBrDrrtprtrurrrZ__parse_string3sJ#	
zBaseCookie.__parse_string)rrrrgrlrnrCrsr@r^rkr`rbro_CookiePatternr{rrrrrs			c@s.eZdZdZddZddZdS)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.
    cCst||fS)N)r0)rArJrrrrlwszSimpleCookie.value_decodecCst|}|t|fS)N)rr)rArJrmrrrrnzszSimpleCookie.value_encodeN)rrrrgrlrnrrrrrps)(rgrestring__all__rvr,reryr	ExceptionrZ
ascii_lettersZdigitsrVZ_UnescapedCharsrWrangemapordrrOcompileescape	fullmatchrrr%r'r0Z_weekdaynameZ
_monthnamer5r?r6Z_LegalKeyCharsZ_LegalValueCharsASCIIrrrrrrr<module>sB				
	)
2