ó
	Q˜[c           @` sš   d  Z  d d l m Z m Z m Z d d l m Z d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d	 „  ƒ  YZ	 d
 e f d „  ƒ  YZ
 [ [ [ [ d S(   u  Response 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.
i    (   t   absolute_importt   divisiont   unicode_literals(   t   objectt   addbasec           B` sD   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   u(   Base class for addinfo and addclosehook.c         C` s   | |  _  |  j  j |  _ |  j  j |  _ t |  j  d ƒ rK |  j  j |  _ n  t |  j  d ƒ ro |  j  j |  _ n d „  |  _ d  S(   Nu	   readlinesu   filenoc           S` s   d  S(   N(   t   None(    (    (    s?   lib/python2.7/site-packages/future/backports/urllib/response.pyt   <lambda>   s    (   t   fpt   readt   readlinet   hasattrt	   readlinest   fileno(   t   selfR   (    (    s?   lib/python2.7/site-packages/future/backports/urllib/response.pyt   __init__   s    	c         C` s   t  |  j ƒ S(   N(   t   iterR   (   R   (    (    s?   lib/python2.7/site-packages/future/backports/urllib/response.pyt   __iter__   s    c         C` s    d |  j  j t |  ƒ |  j f S(   Nu   <%s at %r whose fp = %r>(   t	   __class__t   __name__t   idR   (   R   (    (    s?   lib/python2.7/site-packages/future/backports/urllib/response.pyt   __repr__%   s    c         C` s\   |  j  r |  j  j ƒ  n  d  |  _  d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  S(   N(	   R   t   closeR   R   R	   R   R   R   t   __next__(   R   (    (    s?   lib/python2.7/site-packages/future/backports/urllib/response.pyR   )   s    							c         C` s"   |  j  d  k r t d ƒ ‚ n  |  S(   Nu   I/O operation on closed file(   R   R   t
   ValueError(   R   (    (    s?   lib/python2.7/site-packages/future/backports/urllib/response.pyt	   __enter__4   s    c         C` s   |  j  ƒ  d  S(   N(   R   (   R   t   typet   valuet	   traceback(    (    s?   lib/python2.7/site-packages/future/backports/urllib/response.pyt   __exit__9   s    (	   R   t
   __module__t   __doc__R   R   R   R   R   R   (    (    (    s?   lib/python2.7/site-packages/future/backports/urllib/response.pyR      s   					t   addclosehookc           B` s    e  Z d  Z d „  Z d „  Z RS(   u*   Class to add a close hook to an open file.c         G` s&   t  j |  | ƒ | |  _ | |  _ d  S(   N(   R   R   t	   closehookt   hookargs(   R   R   R    R!   (    (    s?   lib/python2.7/site-packages/future/backports/urllib/response.pyR   ?   s    	c         C` s?   |  j  r. |  j  |  j Œ  d  |  _  d  |  _ n  t j |  ƒ d  S(   N(   R    R!   R   R   R   (   R   (    (    s?   lib/python2.7/site-packages/future/backports/urllib/response.pyR   D   s
    		(   R   R   R   R   R   (    (    (    s?   lib/python2.7/site-packages/future/backports/urllib/response.pyR   <   s   	t   addinfoc           B` s    e  Z d  Z d „  Z d „  Z RS(   u.   class to add an info() method to an open file.c         C` s   t  j |  | ƒ | |  _ d  S(   N(   R   R   t   headers(   R   R   R#   (    (    s?   lib/python2.7/site-packages/future/backports/urllib/response.pyR   N   s    c         C` s   |  j  S(   N(   R#   (   R   (    (    s?   lib/python2.7/site-packages/future/backports/urllib/response.pyt   infoR   s    (   R   R   R   R   R$   (    (    (    s?   lib/python2.7/site-packages/future/backports/urllib/response.pyR"   K   s   	t
   addinfourlc           B` s5   e  Z d  Z d d „ Z d „  Z d „  Z d „  Z RS(   u9   class to add info() and geturl() methods to an open file.c         C` s/   t  j |  | ƒ | |  _ | |  _ | |  _ d  S(   N(   R   R   R#   t   urlt   code(   R   R   R#   R&   R'   (    (    s?   lib/python2.7/site-packages/future/backports/urllib/response.pyR   X   s    		c         C` s   |  j  S(   N(   R#   (   R   (    (    s?   lib/python2.7/site-packages/future/backports/urllib/response.pyR$   ^   s    c         C` s   |  j  S(   N(   R'   (   R   (    (    s?   lib/python2.7/site-packages/future/backports/urllib/response.pyt   getcodea   s    c         C` s   |  j  S(   N(   R&   (   R   (    (    s?   lib/python2.7/site-packages/future/backports/urllib/response.pyt   geturld   s    N(   R   R   R   R   R   R$   R(   R)   (    (    (    s?   lib/python2.7/site-packages/future/backports/urllib/response.pyR%   U   s
   		N(   R   t
   __future__R    R   R   t   future.builtinsR   R   R   R"   R%   (    (    (    s?   lib/python2.7/site-packages/future/backports/urllib/response.pyt   <module>   s   1
