o
    il                     @   sp   d Z ddlmZmZmZ ddlmZ G dd deZG dd deZG dd	 d	eZ	G d
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                   @   s@   e Zd ZdZdd Zdd Zdd Zdd	 Zd
d Zdd Z	dS )addbasez(Base class for addinfo and addclosehook.c                 C   sX   || _ | j j| _| j j| _t| j dr| j j| _t| j dr%| j j| _d S dd | _d S )N	readlinesfilenoc                   S   s   d S N r
   r
   r
   o/var/www/html/eduruby.in/lip-sync/lip-sync-env/lib/python3.10/site-packages/future/backports/urllib/response.py<lambda>   s    z"addbase.__init__.<locals>.<lambda>)fpreadreadlinehasattrr   r   )selfr   r
   r
   r   __init__   s   


zaddbase.__init__c                 C   s
   t | jS r	   )iterr   r   r
   r
   r   __iter__   s   
zaddbase.__iter__c                 C   s   d| j jt| | jf S )Nz<%s at %r whose fp = %r>)	__class____name__idr   r   r
   r
   r   __repr__%   s   
zaddbase.__repr__c                 C   s>   | j r| j   d | _ d | _d | _d | _d | _d | _d | _d S r	   )r   closer   r   r   r   r   __next__r   r
   r
   r   r   )   s   

zaddbase.closec                 C   s   | j d u r	td| S )NzI/O operation on closed file)r   
ValueErrorr   r
   r
   r   	__enter__4   s   
zaddbase.__enter__c                 C   s   |    d S r	   )r   )r   typevalue	tracebackr
   r
   r   __exit__9   s   zaddbase.__exit__N)
r   
__module____qualname____doc__r   r   r   r   r   r!   r
   r
   r
   r   r      s    r   c                   @       e Zd ZdZdd Zdd ZdS )addclosehookz*Class to add a close hook to an open file.c                 G   s   t | | || _|| _d S r	   )r   r   	closehookhookargs)r   r   r'   r(   r
   r
   r   r   ?   s   
zaddclosehook.__init__c                 C   s,   | j r| j | j  d | _ d | _t|  d S r	   )r'   r(   r   r   r   r
   r
   r   r   D   s
   zaddclosehook.closeN)r   r"   r#   r$   r   r   r
   r
   r
   r   r&   <   s    r&   c                   @   r%   )addinfoz.class to add an info() method to an open file.c                 C   s   t | | || _d S r	   )r   r   headers)r   r   r*   r
   r
   r   r   N   s   
zaddinfo.__init__c                 C      | j S r	   r*   r   r
   r
   r   infoR      zaddinfo.infoN)r   r"   r#   r$   r   r-   r
   r
   r
   r   r)   K   s    r)   c                   @   s2   e Zd ZdZdddZdd Zdd Zd	d
 ZdS )
addinfourlz9class to add info() and geturl() methods to an open file.Nc                 C   s"   t | | || _|| _|| _d S r	   )r   r   r*   urlcode)r   r   r*   r0   r1   r
   r
   r   r   X   s   
zaddinfourl.__init__c                 C   r+   r	   r,   r   r
   r
   r   r-   ^   r.   zaddinfourl.infoc                 C   r+   r	   )r1   r   r
   r
   r   getcodea   r.   zaddinfourl.getcodec                 C   r+   r	   )r0   r   r
   r
   r   geturld   r.   zaddinfourl.geturlr	   )r   r"   r#   r$   r   r-   r2   r3   r
   r
   r
   r   r/   U   s    
r/   N)r$   
__future__r   r   r   Zfuture.builtinsr   r   r&   r)   r/   r
   r
   r
   r   <module>   s    1
