
    4pfl                         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
[[[[dS )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                   6    e Zd ZdZd Zd Zd Zd Zd Zd Z	dS )	addbasez(Base class for addinfo and addclosehook.c                    || _         | j         j        | _        | j         j        | _        t          | j         d          r| j         j        | _        t          | j         d          r| j         j        | _        d S d | _        d S )N	readlinesfilenoc                      d S N r       `/var/www/html/nettyfy-visnx/env/lib/python3.11/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__   sp    GL	(47K(( 	/!W.DN47H%% 	''.DKKK&,DKKKr   c                 *    t          | j                  S r   )iterr   r   s    r   __iter__zaddbase.__iter__   s     DG}}r   c                 R    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__%   s3     -1^-D-D-D-/XXXXtwww@ 	@r   c                     | j         r| j                                          d | _         d | _        d | _        d | _        d | _        d | _        d | _        d S r   )r   closer   r   r
   r   r   __next__r   s    r   r$   zaddbase.close)   sP    7 	GMMOOO	r   c                 2    | j         t          d          | S )NzI/O operation on closed file)r   
ValueErrorr   s    r   	__enter__zaddbase.__enter__4   s    7?;<<<r   c                 .    |                                   d S 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      sw        22' ' '  @ @ @	 	 	  
    r   r   c                       e Zd ZdZd Zd ZdS )addclosehookz*Class to add a close hook to an open file.c                 X    t                               | |           || _        || _        d S 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                              |            d S r   )r4   r5   r   r$   r   s    r   r$   zaddclosehook.closeD   sC    > 	!DNDM**!DN DMdr   N)r    r.   r/   r0   r   r$   r   r   r   r2   r2   <   s8        44! ! !
    r   r2   c                       e Zd ZdZd Zd ZdS )addinfoz.class to add an info() method to an open file.c                 J    t                               | |           || _        d S 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   s8        88      r   r8   c                   ,    e Zd ZdZddZd Zd Zd ZdS )
addinfourlz9class to add info() and geturl() methods to an open file.Nc                 f    t                               | |           || _        || _        || _        d S r   )r   r   r:   urlcode)r   r   r:   rB   rC   s        r   r   zaddinfourl.__init__X   s1    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
    yr   c                     | j         S r   )rB   r   s    r   geturlzaddinfourl.geturld   s	    xr   r   )r    r.   r/   r0   r   r=   rF   rH   r   r   r   r@   r@   U   s[        CC           r   r@   N)r0   
__future__r   r   r   future.builtinsr   r   r2   r8   r@   r   r   r   <module>rK      s     C B B B B B B B B B " " " " " "/ / / / /f / / /b    7       g          $ X/r   