D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
lib
/
python3.6
/
site-packages
/
future
/
backports
/
http
/
__pycache__
/
Filename :
cookiejar.cpython-36.opt-1.pyc
back
Copy
3 �c?+ � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZmZm Z m Z mZ ddlm Z mZ dd d ddd ddgZddlZddlZddlZer�de_ddlZddlmZmZmZ ddlmZ yddlZW n ek r� ddlZY nX ddlm Z dZ!da"dd� Z#ee�Z$dZ%dd� Z&dZ'dd� Z(dddd d!d"d#gZ)d$d%d&d'd(d)d*d+d,d-d.d/gZ*g Z+xe*D ]Z,e+j-e,j.� � �q\W d}d0d1�Z/d~d2d3�Z0ddddd4�Z1ej2d5ej�Z3d6d7� Z4d8d9� Z5ej2d:ej�Z6ej2d;ej7ejB �Z8ej2d<ej9ejB �Z:d=d>� Z;ej2d?ej9ejB �Z<d@dA� Z=dBdC� Z>ej2dD�Z?ej2dE�Z@ej2dF�ZAej2dG�ZBdHdI� ZCej2dJ�ZDdKdL� ZEdMdN� ZFdOdP� ZGej2dQej�ZHdRdS� ZIdTdU� ZJdVdW� ZKdXdY� ZLej2dZej�ZMd[d\� ZNd]d^� ZOd_d`� ZPdadb� ZQdcZRej2dd�ZSdedf� ZTdgdh� ZUdidj� ZVdkdl� ZWG dmd� deX�ZYG dnd � d eX�ZZG dod� deZ�Z[dpdq� Z\drds� Z]G dtdu� dueX�Z^G dvd � d eX�Z_G dwd� de`�ZaG dxd� de_�Zbdydz� ZcG d{d � d eb�ZdG d|d� deb�ZedS )a� HTTP cookie handling for web clients. This is a backport of the Py3.3 ``http.cookiejar`` module for python-future. This module has (now fairly distant) origins in Gisle Aas' Perl module HTTP::Cookies, from the libwww-perl library. Docstrings, comments and debug strings in this code refer to the attributes of the HTTP cookie system as cookie-attributes, to distinguish them clearly from Python attributes. Class diagram (note that BSDDBCookieJar and the MSIE* classes are not distributed with the Python standard library, but are available from http://wwwsearch.sf.net/): CookieJar____ / \ \ FileCookieJar \ \ / | \ \ \ MozillaCookieJar | LWPCookieJar \ \ | | \ | ---MSIEBase | \ | / | | \ | / MSIEDBCookieJar BSDDBCookieJar |/ MSIECookieJar � )�unicode_literals)�print_function)�division)�absolute_import)�filter�int�map�open�str)� as_native_str�PY2�Cookie� CookieJar�CookiePolicy�DefaultCookiePolicy� FileCookieJar�LWPCookieJar� LoadError�MozillaCookieJarN)�urlparse�urlsplit�quote)� HTTP_PORT)�timegmFc G s( t sd S tsdd l}|jd�atj | � S )Nr zhttp.cookiejar)�debug�logger�loggingZ getLogger)�argsr � r �/usr/lib/python3.6/cookiejar.py�_debug: s r zQa filename was not supplied (nor was the CookieJar instance initialised with one)c C sJ dd l } dd l}dd l}| j� }|jd |� |j� }|jd| dd� d S )Nr zhttp.cookiejar bug! %s� )� stacklevel)�io�warnings� traceback�StringIO� print_exc�getvalue�warn)r# r$ r% �f�msgr r r �_warn_unhandled_exceptionH s r, i� c C s� | d d� \}}}}}}|t kr�d| ko2dkn r�d| koJdkn r�d| kobdkn r�d| kozdkn r�d| ko�dkn r�t| �S d S d S ) N� � � � r � �; �= )� EPOCH_YEARr )�tt�year�monthZmday�hour�min�secr r r �_timegmW s 8Hr; ZMonZTueZWedZThuZFriZSatZSunZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDecc C s@ | dkrt j j� }nt j j| �}d|j|j|j|j|j|jf S )aH Return a string representing time in seconds since epoch, t. If the function is called without an argument, it will use the current time. The format of the returned string is like "YYYY-MM-DD hh:mm:ssZ", representing Universal Time (UTC, aka GMT). An example of this format is: 1994-11-24 08:49:37Z Nz%04d-%02d-%02d %02d:%02d:%02dZ) �datetime�utcnow�utcfromtimestampr6 r7 �dayr8 �minute�second)�t�dtr r r � time2isoze s rD c C sR | dkrt j j� }nt j j| �}dt|j� |jt|jd |j|j |j |jf S )z�Return a string representing time in seconds since epoch, t. If the function is called without an argument, it will use the current time. The format of the returned string is like this: Wed, DD-Mon-YYYY HH:MM:SS GMT Nz"%s %02d-%s-%04d %02d:%02d:%02d GMTr. )r<