
    Fwgl                         d Z ddlmZmZmZ ddlmZ  G d de      Z G d de      Z G d d	e      Z	 G d
 de      Z
[[[[y)a  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.
    )absolute_importdivisionunicode_literals)objectc                   4    e Zd ZdZd Zd Zd Zd Zd Zd Z	y)	addbasez(Base class for addinfo and addclosehook.c                 T   || _         | j                   j                  | _        | j                   j                  | _        t        | j                   d      r| j                   j                  | _        t        | j                   d      r| j                   j
                  | _        y d | _        y )N	readlinesfilenoc                       y N r       W/var/www/horilla/myenv/lib/python3.12/site-packages/future/backports/urllib/response.py<lambda>z"addbase.__init__.<locals>.<lambda>   s    r   )fpreadreadlinehasattrr
   r   )selfr   s     r   __init__zaddbase.__init__   sl    GGLL	((477K(!WW..DN477H%''..DK&DKr   c                 ,    t        | j                        S r   )iterr   r   s    r   __iter__zaddbase.__iter__   s     DGG}r   c                 h    d| j                   j                  dt        |       d| j                  dS )N<z at z whose fp = >)	__class____name__idr   r   s    r   __repr__zaddbase.__repr__%   s(    -1^^-D-D-/Xtww@ 	@r   c                     | j                   r| j                   j                          d | _         d | _        d | _        d | _        d | _        d | _        d | _        y r   )r   closer   r   r
   r   r   __next__r   s    r   r$   zaddbase.close)   sG    77GGMMO	r   c                 4    | j                   t        d      | S )NzI/O operation on closed file)r   
ValueErrorr   s    r   	__enter__zaddbase.__enter__4   s    77?;<<r   c                 $    | j                          y r   )r$   )r   typevalue	tracebacks       r   __exit__zaddbase.__exit__9   s    

r   N)
r    
__module____qualname____doc__r   r   r"   r$   r(   r-   r   r   r   r   r      s$    2'@	
r   r   c                       e Zd ZdZd Zd Zy)addclosehookz*Class to add a close hook to an open file.c                 L    t         j                  | |       || _        || _        y r   )r   r   	closehookhookargs)r   r   r4   r5   s       r   r   zaddclosehook.__init__?   s     r"" r   c                     | j                   r' | j                   | j                    d | _         d | _        t        j                  |        y r   )r4   r5   r   r$   r   s    r   r$   zaddclosehook.closeD   s5    >>DNNDMM*!DN DMdr   N)r    r.   r/   r0   r   r$   r   r   r   r2   r2   <   s    4!
r   r2   c                       e Zd ZdZd Zd Zy)addinfoz.class to add an info() method to an open file.c                 >    t         j                  | |       || _        y r   )r   r   headers)r   r   r:   s      r   r   zaddinfo.__init__N   s    r"r   c                     | j                   S r   r:   r   s    r   infozaddinfo.infoR       ||r   N)r    r.   r/   r0   r   r=   r   r   r   r8   r8   K   s    8r   r8   c                   *    e Zd ZdZddZd Zd Zd Zy)
addinfourlz9class to add info() and geturl() methods to an open file.Nc                 Z    t         j                  | |       || _        || _        || _        y r   )r   r   r:   urlcode)r   r   r:   rB   rC   s        r   r   zaddinfourl.__init__X   s'    r"	r   c                     | j                   S r   r<   r   s    r   r=   zaddinfourl.info^   r>   r   c                     | j                   S r   )rC   r   s    r   getcodezaddinfourl.getcodea   s    yyr   c                     | j                   S r   )rB   r   s    r   geturlzaddinfourl.geturld   s    xxr   r   )r    r.   r/   r0   r   r=   rF   rH   r   r   r   r@   r@   U   s    Cr   r@   N)r0   
__future__r   r   r   future.builtinsr   r   r2   r8   r@   r   r   r   <module>rK      sS    C B "/f /b7 g  $ X/r   