ok

Mini Shell

Direktori : /opt/alt/python35/lib64/python3.5/http/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/http/__pycache__/cookies.cpython-35.opt-2.pyc



���]>S�
@sddlZddlZdddgZdjZdjZdjZdd	�ZGd
d�de�Z	ej
ejdZedZ
d
d�eed��eeee
��D�Zejed�ded�di�ejdeje��jZdd�Zejd�Zejd�Zdd�Zdddddd d!gZdd"d#d$d%d&d'd(d)d*d+d,d-g
Zdeed.d/�ZGd0d1�d1e�Z d2Z!e!d3Z"ejd4e!d5e"d6ej#�Z$Gd7d�de�Z%Gd8d�de%�Z&dS)9�N�CookieError�
BaseCookie�SimpleCookie�z; � cCs0ddl}d|}|j|tdd�dS)NrzvThe .%s setter is deprecated. The attribute will be read-only in future releases. Please use the set() method instead.�
stacklevel�)�warnings�warn�DeprecationWarning)�setterr	�msg�r�,/opt/alt/python35/lib64/python3.5/cookies.py�_warn_deprecated_setter�src@seZdZdS)rN)�__name__�
__module__�__qualname__rrrrr�sz!#$%&'*+-.^_`|~:z
 ()/<=>?@[]{}cCsi|]}d||�qS)z\%03or)�.0�nrrr�
<dictcomp>�s	r��"z\"�\z\\z[%s]+cCs5|dkst|�r|Sd|jt�dSdS)Nr)�
_is_legal_key�	translate�_Translator)�strrrr�_quote�srz\\[0-3][0-7][0-7]z[\\].cCs�|dkst|�dkr"|S|ddksB|ddkrF|S|dd�}d}t|�}g}x?d|ko�|knr�tj||�}tj||�}|r�|r�|j||d��Pd	}}|r�|jd�}|r|jd�}|r]|s$||kr]|j|||��|j||d�|d}qq|j|||��|jtt||d|d�d���|d}qqWt|�S)
N�rr������r#r#)	�len�
_OctalPatt�search�
_QuotePatt�append�start�chr�int�	_nulljoin)r�ir�resZo_matchZq_match�j�krrr�_unquote�s6 

.r1ZMonZTueZWedZThuZFriZSatZSunZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDecc	Csoddlm}m}|�}|||�\	}}}}	}
}}}
}d|||||||	|
|fS)Nr)�gmtime�timez#%s, %02d %3s %4d %02d:%02d:%02d GMT)r3r2)�futureZweekdaynameZ	monthnamer2r3ZnowZyearZmonthZdayZhhZmm�ssZwd�y�zrrr�_getdate�s
	+r8c@s�eZdZdddddddddd	d
ddd
ddiZd
dhZdd�Zedd��Zejdd��Zedd��Z	e	jdd��Z	edd��Z
e
jdd��Z
dd�Zddd�Zd d!�Z
ejZd"d#�Zd$d%�Zd&d'�Zed(d)�Zd*d+�Zd,d-�Zdd.d/d0�ZeZd1d2�Zdd3d4�Zdd5d6�ZdS)7�Morsel�expires�pathZPathZcomment�Comment�domainZDomainzmax-agezMax-AgeZsecureZSecureZhttponlyZHttpOnly�versionZVersioncCsBd|_|_|_x$|jD]}tj||d�q!WdS)Nr)�_key�_value�_coded_value�	_reserved�dict�__setitem__)�self�keyrrr�__init__&szMorsel.__init__cCs|jS)N)r?)rErrrrF.sz
Morsel.keycCstd�||_dS)NrF)rr?)rErFrrrrF2s
cCs|jS)N)r@)rErrr�value7szMorsel.valuecCstd�||_dS)NrH)rr@)rErHrrrrH;s
cCs|jS)N)rA)rErrr�coded_value@szMorsel.coded_valuecCstd�||_dS)NrI)rrA)rErIrrrrIDs
cCsE|j�}||jkr.td|f��tj|||�dS)NzInvalid attribute %r)�lowerrBrrCrD)rE�K�VrrrrDIszMorsel.__setitem__NcCsA|j�}||jkr.td|f��tj|||�S)NzInvalid attribute %r)rJrBrrC�
setdefault)rErF�valrrrrMOszMorsel.setdefaultcCsYt|t�stStj||�oX|j|jkoX|j|jkoX|j|jkS)N)�
isinstancer9�NotImplementedrC�__eq__r@r?rA)rE�morselrrrrQUsz
Morsel.__eq__cCs0t�}tj||�|jj|j�|S)N)r9rC�update�__dict__)rErRrrr�copy_s	zMorsel.copycCsui}xXt|�j�D]D\}}|j�}||jkrStd|f��|||<qWtj||�dS)NzInvalid attribute %r)rC�itemsrJrBrrS)rE�values�datarFrNrrrrSesz
Morsel.updatecCs|j�|jkS)N)rJrB)rErKrrr�
isReservedKeynszMorsel.isReservedKeycCs�|tkr.ddl}|jdtdd�|j�|jkrVtd|f��t|�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
rrJrBrrr?r@rA)rErFrNZ	coded_valZ
LegalCharsr	rrr�setqs		z
Morsel.setcCsd|jd|jd|jiS)NrFrHrI)r?r@rA)rErrr�__getstate__�s		zMorsel.__getstate__cCs+|d|_|d|_|d|_dS)NrFrHrI)r?r@rA)rE�staterrr�__setstate__�s

zMorsel.__setstate__zSet-Cookie:cCsd||j|�fS)Nz%s %s)�OutputString)rE�attrs�headerrrr�output�sz
Morsel.outputcCsd|jj|j�fS)Nz<%s: %s>)�	__class__rr_)rErrr�__repr__�szMorsel.__repr__cCsd|j|�jdd�S)Nz�
        <script type="text/javascript">
        <!-- begin hiding
        document.cookie = "%s";
        // end hiding -->
        </script>
        rz\")r_�replace)rEr`rrr�	js_output�szMorsel.js_outputcCsQg}|j}|d|j|jf�|dkr>|j}t|j��}x�|D]�\}}|dkrrqW||kr�qW|dkr�t|t�r�|d|j|t|�f�qW|dkr�t|t�r�|d|j||f�qW||j	kr(|rC|t
|j|��qW|d|j||f�qWWt|�S)Nz%s=%srr:zmax-agez%s=%d)r(rFrIrB�sortedrVrOr+r8�_flagsr�_semispacejoin)rEr`�resultr(rVrFrHrrrr_�s(		$zMorsel.OutputString)rrrrBrhrG�propertyrFrrHrIrDrMrQ�object�__ne__rUrSrYrZr[r\r^rb�__str__rdrfr_rrrrr9s>		
r9z,\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@s�eZdZdd�Zdd�Zddd�Zdd	�Zd
d�Zddd
dd�ZeZ	dd�Z
ddd�Zdd�Ze
dd�ZdS)rcCs
||fS)Nr)rErNrrr�value_decode�szBaseCookie.value_decodecCst|�}||fS)N)r)rErN�strvalrrr�value_encode�szBaseCookie.value_encodeNcCs|r|j|�dS)N)�load)rE�inputrrrrG�szBaseCookie.__init__cCs?|j|t��}|j|||�tj|||�dS)N)�getr9r[rCrD)rErFZ
real_valuerI�MrrrZ__set�szBaseCookie.__setcCsQt|t�r%tj|||�n(|j|�\}}|j|||�dS)N)rOr9rCrDrq�_BaseCookie__set)rErFrH�rval�cvalrrrrDszBaseCookie.__setitem__zSet-Cookie:z
cCsUg}t|j��}x-|D]%\}}|j|j||��qW|j|�S)N)rgrVr(rb�join)rEr`ra�seprjrVrFrHrrrrbs
zBaseCookie.outputcCsig}t|j��}x4|D],\}}|jd|t|j�f�qWd|jjt|�fS)Nz%s=%sz<%s: %s>)rgrVr(�reprrHrcr�
_spacejoin)rE�lrVrFrHrrrrds
$zBaseCookie.__repr__cCsOg}t|j��}x*|D]"\}}|j|j|��qWt|�S)N)rgrVr(rfr,)rEr`rjrVrFrHrrrrfs
zBaseCookie.js_outputcCsJt|t�r|j|�n'x$|j�D]\}}|||<q,WdS)N)rOr�_BaseCookie__parse_stringrV)rEZrawdatarFrHrrrrr%s
zBaseCookie.loadcCs�d}t|�}g}d}d}d}xZd|koD|knr�|j||�}	|	sbP|	jd�|	jd�}
}|	jd�}|
ddkr�|s�q-|j||
dd�|f�q-|
j�tjkrK|s�dS|dkr,|
j�tjkr%|j||
df�qHdSq�|j||
t	|�f�q-|dk	r|j||
|j
|�f�d}q-dSq-Wd}xY|D]Q\}
}
}|
|kr�|||
<q�|\}}|j|
||�||
}q�WdS)	NrFr rrFrN�$T)r$�match�group�endr(rJr9rBrhr1rorv)rErZpattr-rZparsed_itemsZmorsel_seenZTYPE_ATTRIBUTEZ
TYPE_KEYVALUEr�rFrHru�tprwrxrrrZ__parse_string3sF#	
zBaseCookie.__parse_string)rrrrorqrGrvrDrbrnrdrfrr�_CookiePatternr~rrrrr�s			c@s(eZdZdd�Zdd�ZdS)rcCst|�|fS)N)r1)rErNrrrrowszSimpleCookie.value_decodecCst|�}|t|�fS)N)rr)rErNrprrrrqzszSimpleCookie.value_encodeN)rrrrorqrrrrrps)'�re�string�__all__ryr,rir|r�	Exceptionr�
ascii_letters�digitsrZZ_UnescapedCharsr[�range�map�ordrrS�compile�escape�	fullmatchrrr%r'r1Z_weekdaynameZ
_monthnamer8rCr9Z_LegalKeyCharsZ_LegalValueChars�ASCIIr�rrrrrr�<module>�s@				
	)
2�

�

Zerion Mini Shell 1.0