Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.6/site-packages/future/backports/http/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.6/site-packages/future/backports/http/__pycache__/cookies.cpython-36.pyc

3

�uGhMT��@s�dZddlmZddlmZddlmZddlmZddlmZmZm	Z	m
Z
ddlmZm
Z
ddlZernde_ddlZd	d
dgZdjZd
jZdjZGdd	�d	e�ZejejdZdddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d���Zefd�d��Zejd��Zejd��Zd�d��Z d�d�d�d�d�d�d�gZ!dd�d�d�d�d�d�d�d�d�d�d�d�g
Z"de!e"fd�dфZ#Gd�dӄd�e�Z$d�Z%ejd�e%d�e%d�ej�Z&Gd�d
�d
e�Z'Gd�d�de'�Z(dS)�af

http.cookies module ported to python-future from Py3.3

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.
�)�unicode_literals)�print_function)�division)�absolute_import)�chr�dict�int�str)�PY2�
as_native_strN�CookieError�
BaseCookie�SimpleCookie�z; � c@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�D/root/tmp/pip-build-gzoz1_uw/future/future/backports/http/cookies.pyr�sz!#$%&'*+-.^_`|~:z\000z\001z\002z\003z\004z\005z\006z\007z\010z\011z\012z\013z\014z\015z\016z\017z\020z\021z\022z\023z\024z\025z\026z\027z\030z\031z\032z\033z\034z\035z\036z\037z\054z\073z\"z\\z\177z\200z\201z\202z\203z\204z\205z\206z\207z\210z\211z\212z\213z\214z\215z\216z\217z\220z\221z\222z\223z\224z\225z\226z\227z\230z\231z\232z\233z\234z\235z\236z\237z\240z\241z\242z\243z\244z\245z\246z\247z\250z\251z\252z\253z\254z\255z\256z\257z\260z\261z\262z\263z\264z\265z\266z\267z\270z\271z\272z\273z\274z\275z\276z\277z\300z\301z\302z\303z\304z\305z\306z\307z\310z\311z\312z\313z\314z\315z\316z\317z\320z\321z\322z\323z\324z\325z\326z\327z\330z\331z\332z\333z\334z\335z\336z\337z\340z\341z\342z\343z\344z\345z\346z\347z\350z\351z\352z\353z\354z\355z\356z\357z\360z\361z\362z\363z\364z\365z\366z\367z\370z\371z\372z\373z\374z\375z\376z\377)�����������	�
���
�������������������,�;�"�\��€��‚�ƒ�„�…�†�‡�ˆ�‰�Š�‹�Œ��Ž���‘�’�“�”�•�–�—�˜�™�š�›�œ��ž�Ÿ� �¡�¢�£�¤�¥�¦�§�¨�©�ª�«�¬�­�®�¯�°�±�²�³�´�µ�¶�·�¸�¹�º�»�¼�½�¾�¿�À�Á�Â�Ã�Ä�Å�Æ�Ç�È�É�Ê�Ë�Ì�Í�Î�Ï�Ð�Ñ�Ò�Ó�Ô�Õ�Ö�×�Ø�Ù�Ú�Û�Ü�Ý�Þ�ß�à�á�â�ã�ä�å�æ�ç�è�é�ê�ë�ì�í�î�ï�ð�ñ�ò�ó�ô�õ�ö�÷�ø�ù�ú�û�ü�ý�þ�ÿcs8t�fdd�|D��r|Sdtdd�|D��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.
    c3s|]}|�kVqdS)Nr)�.0�c)�
LegalCharsrr�	<genexpr>�sz_quote.<locals>.<genexpr>r8css|]}tj||�VqdS)N)�_Translator�get)r��srrrr��sN)�all�	_nulljoin)r	r�r)r�r�_quote�sr�z\\[0-3][0-7][0-7]z[\\].cCsLt|�dkr|S|ddks(|ddkr,|S|dd�}d}t|�}g}x�d|ko\|kn�rBtj||�}tj||�}|r�|r�|j||d��Pd	}}|r�|jd�}|r�|jd�}|o�|s�||k�r|j|||��|j||d�|d}qJ|j|||��|jtt||d|d�d���|d}qJWt|�S)
N�rr8������r�r�)	�len�
_OctalPatt�search�
_QuotePatt�append�startrrr�)�mystr�i�n�res�o_match�q_match�j�krrr�_unquote�s6


$r��Mon�Tue�Wed�Thu�Fri�Sat�Sun�Jan�Feb�Mar�Apr�May�Jun�Jul�Aug�Sep�Oct�Nov�Decc	CsRddlm}m}|�}|||�\	}}}}	}
}}}
}d|||||||	|
|fS)Nr)�gmtime�timez#%s, %02d %3s %4d %02d:%02d:%02d GMT)r�r�)�future�weekdayname�	monthnamer�r��now�year�month�day�hh�mm�ss�wd�y�zrrr�_getdate3s
r�c	@s�eZdZdZdddddddd	d
�Zeddg�Zdd�Zd
d�Zdd�Z	e
fdd�Zddd�ZeZe
�dd��Zddd�Zddd�ZdS) �Morsela�A 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.
    �expires�Path�Comment�DomainzMax-Age�secure�httponly�Version)r��path�comment�domainzmax-agerr�versioncCs4d|_|_|_x|jD]}tj||d�qWdS)Nr)�key�value�coded_value�	_reservedr�__setitem__)�selfrrrr�__init__^szMorsel.__init__cCs0|j�}||jkrtd|��tj|||�dS)NzInvalid Attribute %s)�lowerrrrr)r
�K�Vrrrrfs
zMorsel.__setitem__cCs|j�|jkS)N)rr)r
rrrr�
isReservedKeylszMorsel.isReservedKeycsR|j�|jkrtd|��t�fdd�|D��r<td|��||_||_||_dS)Nz!Attempt to set a reserved key: %sc3s|]}|�kVqdS)Nr)r�r�)r�rrr�tszMorsel.set.<locals>.<genexpr>zIllegal key value: %s)rrr�anyrr	r
)r
r�val�	coded_valr�r)r�r�setosz
Morsel.setN�Set-Cookie:cCsd||j|�fS)Nz%s %s)�OutputString)r
�attrs�headerrrr�output|sz
Morsel.outputcCs>trt|jt�rt|j�}n|j}d|jjt|j�t|�fS)Nz<%s: %s=%s>)	r
�
isinstancer	�unicoder	�	__class__rr�repr)r
rrrr�__repr__�s
zMorsel.__repr__cCsd|j|�jdd�S)Nz�
        <script type="text/javascript">
        <!-- begin hiding
        document.cookie = "%s";
        // end hiding -->
        </script>
        r8z\")r�replace)r
rrrr�	js_output�szMorsel.js_outputcCsg}|j}|d|j|jf�|dkr,|j}t|j��}x�|D]�\}}|dkrPq>||krZq>|dkr�t|t�r�|d|j|t|�f�q>|dkr�t|t�r�|d|j||f�q>|dkr�|t	|j|��q>|dkr�|t	|j|��q>|d|j||f�q>Wt
|�S)Nz%s=%srr�zmax-agez%s=%drr)r�rr
r�sorted�itemsrrr�r	�_semispacejoin)r
r�resultr�r$rr	rrrr�s*zMorsel.OutputString)Nr)N)N)rrr�__doc__rr�_flagsrrr�_LegalCharsr�__str__rr r"rrrrrr�;s&
	

r�z.[\w\d!#%&'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{\=]z~
    (?x)                           # This is a verbose pattern
    (?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@steZdZdZdd�Zdd�Zddd�Zd	d
�Zdd�Zddd�Z	e	Z
e�dd��Zddd�Z
dd�Zefdd�ZdS)r
z'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)r
rrrr�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	)r
r�strvalrrr�value_encode�szBaseCookie.value_encodeNcCs|r|j|�dS)N)�load)r
�inputrrrr�szBaseCookie.__init__cCs.|j|t��}|j|||�tj|||�dS)z+Private method for setting a cookie's valueN)r�r�rrr)r
r�
real_valuer
�Mrrr�__set�szBaseCookie.__setcCs |j|�\}}|j|||�dS)zDictionary style assignment.N)r-�_BaseCookie__set)r
rr	�rval�cvalrrrr�szBaseCookie.__setitem__�Set-Cookie:�
cCs>g}t|j��}x"|D]\}}|j|j||��qW|j|�S)z"Return a string suitable for HTTP.)r#r$r�r�join)r
rr�sepr&r$rr	rrrr�s
zBaseCookie.outputcCsrg}t|j��}xL|D]D\}}tr:t|jt�r:t|j�}n|j}|jdt|�t|�f�qWd|j	j
t|�fS)Nz%s=%sz<%s: %s>)r#r$r
rr	rr	r�rrr�
_spacejoin)r
�lr$rr	rrrrr szBaseCookie.__repr__cCs:g}t|j��}x |D]\}}|j|j|��qWt|�S)z(Return a string suitable for JavaScript.)r#r$r�r"r�)r
rr&r$rr	rrrr"s
zBaseCookie.js_outputcCs8t|t�r|j|�nx|j�D]\}}|||<q WdS)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)rr	�_BaseCookie__parse_stringr$)r
�rawdatarr	rrrr.s

zBaseCookie.loadcCs�d}t|�}d}x�d|ko$|knr�|j||�}|s<P|jd�|jd�}}|jd�}|ddkr~|r�|||dd�<q|j�tjkr�|r�|dkr�|j�tjkr�d||<q�t|�||<q|dk	r|j	|�\}	}
|j
||	|
�||}qWdS)Nrrr�$r�T)r�r��group�endrr�rr(r�r+r3)r
r��pattr�r�r1�matchrr	r4r5rrr�__parse_string&s,

zBaseCookie.__parse_string)N)Nr6r7)N)rrrr'r+r-rr3rrr*rr r"r.�_CookiePatternr<rrrrr
�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|�|fS)N)r�)r
rrrrr+QszSimpleCookie.value_decodecCst|�}|t|�fS)N)r	r�)r
rr,rrrr-TszSimpleCookie.value_encodeN)rrrr'r+r-rrrrrJs))r'�
__future__rrrrZfuture.builtinsrrrr	Zfuture.utilsr
r�re�ASCII�string�__all__r8r�r%r:�	Exceptionr�
ascii_letters�digitsr)r�r��compiler�r�r��_weekdayname�
_monthnamer�r�Z_LegalCharsPattrDr
rrrrr�<module>�s�


2t

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists