????

Your IP : 3.16.130.230


Current Path : /usr/lib/python3.6/site-packages/future/backports/urllib/__pycache__/
Upload File :
Current File : //usr/lib/python3.6/site-packages/future/backports/urllib/__pycache__/response.cpython-36.opt-1.pyc

3

�cl�@spdZddlmZmZmZddlmZGdd�de�ZGdd�de�ZGdd	�d	e�Z	Gd
d�de�Z
[[[[dS)
aResponse classes used by urllib.

The base class, addbase, defines a minimal file-like interface,
including read() and readline().  The typical response object is an
addinfourl instance, which defines an info() method that returns
headers and a geturl() method that returns the url.
�)�absolute_import�division�unicode_literals)�objectc@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�addbasez(Base class for addinfo and addclosehook.cCsV||_|jj|_|jj|_t|jd�r0|jj|_t|jd�rH|jj|_n
dd�|_dS)N�	readlines�filenocSsdS)N�r	r	r	�/usr/lib/python3.6/response.py�<lambda>sz"addbase.__init__.<locals>.<lambda>)�fp�read�readline�hasattrrr)�selfrr	r	r
�__init__s


zaddbase.__init__cCs
t|j�S)N)�iterr)rr	r	r
�__iter__szaddbase.__iter__cCsd|jjt|�|jfS)Nz<%s at %r whose fp = %r>)�	__class__�__name__�idr)rr	r	r
�__repr__%szaddbase.__repr__cCs>|jr|jj�d|_d|_d|_d|_d|_d|_d|_dS)N)r�closer
rrrr�__next__)rr	r	r
r)s
z
addbase.closecCs|jdkrtd��|S)NzI/O operation on closed file)r�
ValueError)rr	r	r
�	__enter__4s
zaddbase.__enter__cCs|j�dS)N)r)r�type�value�	tracebackr	r	r
�__exit__9szaddbase.__exit__N)
r�
__module__�__qualname__�__doc__rrrrrrr	r	r	r
rs
rc@s eZdZdZdd�Zdd�ZdS)�addclosehookz*Class to add a close hook to an open file.cGstj||�||_||_dS)N)rr�	closehook�hookargs)rrr$r%r	r	r
r?szaddclosehook.__init__cCs,|jr|j|j�d|_d|_tj|�dS)N)r$r%rr)rr	r	r
rDs
zaddclosehook.closeN)rr r!r"rrr	r	r	r
r#<sr#c@s eZdZdZdd�Zdd�ZdS)�addinfoz.class to add an info() method to an open file.cCstj||�||_dS)N)rr�headers)rrr'r	r	r
rNszaddinfo.__init__cCs|jS)N)r')rr	r	r
�infoRszaddinfo.infoN)rr r!r"rr(r	r	r	r
r&Ksr&c@s2eZdZdZddd�Zdd�Zdd�Zd	d
�ZdS)�
addinfourlz9class to add info() and geturl() methods to an open file.NcCs"tj||�||_||_||_dS)N)rrr'�url�code)rrr'r*r+r	r	r
rXszaddinfourl.__init__cCs|jS)N)r')rr	r	r
r(^szaddinfourl.infocCs|jS)N)r+)rr	r	r
�getcodeaszaddinfourl.getcodecCs|jS)N)r*)rr	r	r
�geturldszaddinfourl.geturl)N)rr r!r"rr(r,r-r	r	r	r
r)Us

r)N)r"Z
__future__rrrZfuture.builtinsrrr#r&r)r	r	r	r
�<module>s1