관리-도구
편집 파일: cookiejar.cpython-37.pyc
B �A�[�* � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZmZm Z m Z mZ ddlm Z dd d ddd ddgZddlZddlZddlZde_ddlZddlmZmZmZ ddlmZ yddlZW n ek r� ddlZY nX ddlmZ 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*�,e+�-� � �qTW d}d0d1�Z.d~d2d3�Z/ddddd4�Z0e�1d5ej�Z2d6d7� Z3d8d9� Z4e�1d:ej�Z5e�1d;ej6ejB �Z7e�1d<ej8ejB �Z9d=d>� Z:e�1d?ej8ejB �Z;d@dA� Z<dBdC� Z=e�1dD�Z>e�1dE�Z?e�1dF�Z@e�1dG�ZAdHdI� ZBe�1dJ�ZCdKdL� ZDdMdN� ZEdOdP� ZFe�1dQej�ZGdRdS� ZHdTdU� ZIdVdW� ZJdXdY� ZKe�1dZej�ZLd[d\� ZMd]d^� ZNd_d`� ZOdadb� ZPdcZQe�1dd�ZRdedf� ZSdgdh� ZTdidj� ZUdkdl� ZVG dmd� deW�ZXG dnd � d eW�ZYG dod� deY�ZZdpdq� Z[drds� Z\G dtdu� dueW�Z]G dvd � d eW�Z^G dwd� de_�Z`G dxd� de^�Zadydz� ZbG d{d � d ea�ZcG d|d� dea�ZddS )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�Cookie� CookieJar�CookiePolicy�DefaultCookiePolicy� FileCookieJar�LWPCookieJar� LoadError�MozillaCookieJarN)�urlparse�urlsplit�quote)� HTTP_PORT)�timegmFc G s( t sd S tsdd l}|�d�atj | � S )Nr zhttp.cookiejar)�debug�logger�logging� getLogger)�argsr � r �P/opt/alt/python37/lib/python3.7/site-packages/future/backports/http/cookiejar.py�_debug9 s r zQa filename was not supplied (nor was the CookieJar instance initialised with one)c C sJ dd l } dd l}dd l}| �� }|�d |� |�� }|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_exceptionG s r, i� c C s� | d d� \}}}}}}|t kr�d| kr4dkr�n nhd| krLdkr�n nPd| krddkr�n n8d| kr|dkr�n n d| kr�dkr�n nt| �S d S d S ) N� � � � r � �; �= )� EPOCH_YEARr )�tt�year�monthZmday�hour�min�secr r r �_timegmV s 8Hr; �Mon�Tue�Wed�Thu�Fri�Sat�Sun�Jan�Feb�Mar�Apr�May�Jun�Jul�Aug�Sep�Oct�Nov�Decc C s@ | dkrt j �� }nt 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 � time2isozd s rW c C sR | dkrt j �� }nt j �| �}dt|�� |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. )rO rP rQ �DAYS�weekdayrR �MONTHSr7 r6 r8 rS rT )rU rV r r r � time2netscapew s r[ )�GMT�UTC�UT�Zz^([-+])?(\d\d?):?(\d\d)?$c C sj d }| t krd}nTt�| �}|rfdt|�d�� }|�d�rR|dt|�d�� }|�d�dkrf| }|S )Nr i r! � �<