
    9il                         S r SSKJrJrJr  SSKJr   " S S\5      r " S S\5      r " S S	\5      r	 " S
 S\5      r
CCCCg)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                   <    \ rS rSrSrS rS rS rS rS r	S r
S	rg
)addbase   z(Base class for addinfo and addclosehook.c                 f   Xl         U R                   R                  U l        U R                   R                  U l        [        U R                   S5      (       a  U R                   R                  U l        [        U R                   S5      (       a  U R                   R
                  U l        g S U l        g )N	readlinesfilenoc                      g N r       `/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/future/backports/urllib/response.py<lambda>"addbase.__init__.<locals>.<lambda>   s    $r   )fpreadreadlinehasattrr   r   )selfr   s     r   __init__addbase.__init__   sp    GGLL	((477K((!WW..DN477H%%''..DK&DKr   c                 ,    [        U R                  5      $ r   )iterr   r   s    r   __iter__addbase.__iter__   s     DGG}r   c                 n    SU R                   R                  < S[        U 5      < SU R                  < S3$ )N<z at z whose fp = >)	__class____name__idr   r   s    r   __repr__addbase.__repr__%   s(    -1^^-D-D-/Xtww@ 	@r   c                     U R                   (       a  U R                   R                  5         S U l         S U l        S U l        S U l        S U l        S U l        S U l        g r   )r   closer   r   r   r   r   __next__r   s    r   r)   addbase.close)   sG    77GGMMO	r   c                 6    U R                   c  [        S5      eU $ )NzI/O operation on closed file)r   
ValueErrorr   s    r   	__enter__addbase.__enter__4   s    77?;<<r   c                 $    U R                  5         g r   )r)   )r   typevalue	tracebacks       r   __exit__addbase.__exit__9   s    

r   )r   r*   r   r   r   r   r   N)r$   
__module____qualname____firstlineno____doc__r   r   r&   r)   r.   r4   __static_attributes__r   r   r   r   r      s$    2'@	
r   r   c                   $    \ rS rSrSrS rS rSrg)addclosehook<   z*Class to add a close hook to an open file.c                 F    [         R                  X5        X l        X0l        g r   )r   r   	closehookhookargs)r   r   r?   r@   s       r   r   addclosehook.__init__?   s    "" r   c                     U R                   (       a'  U R                   " U R                  6   S U l         S U l        [        R                  U 5        g r   )r?   r@   r   r)   r   s    r   r)   addclosehook.closeD   s3    >>NNDMM*!DN DMdr   )r?   r@   N)r$   r6   r7   r8   r9   r   r)   r:   r   r   r   r<   r<   <   s    4!
r   r<   c                   $    \ rS rSrSrS rS rSrg)addinfoK   z.class to add an info() method to an open file.c                 :    [         R                  X5        X l        g r   )r   r   headers)r   r   rH   s      r   r   addinfo.__init__N   s    "r   c                     U R                   $ r   rH   r   s    r   infoaddinfo.infoR       ||r   rK   N)r$   r6   r7   r8   r9   r   rL   r:   r   r   r   rE   rE   K   s    8r   rE   c                   4    \ rS rSrSrS	S jrS rS rS rSr	g)

addinfourlU   z9class to add info() and geturl() methods to an open file.Nc                 R    [         R                  X5        X l        X0l        X@l        g r   )r   r   rH   urlcode)r   r   rH   rS   rT   s        r   r   addinfourl.__init__X   s    "	r   c                     U R                   $ r   rK   r   s    r   rL   addinfourl.info^   rN   r   c                     U R                   $ r   )rT   r   s    r   getcodeaddinfourl.getcodea   s    yyr   c                     U R                   $ r   )rS   r   s    r   geturladdinfourl.geturld   s    xxr   )rT   rH   rS   r   )
r$   r6   r7   r8   r9   r   rL   rY   r\   r:   r   r   r   rP   rP   U   s    Cr   rP   N)r9   
__future__r   r   r   future.builtinsr   r   r<   rE   rP   r   r   r   <module>r`      sS    C B "/f /b7 g  $ X/r   