� c��j9 ���dZddlZgd�ZGd�dej�ZGd�de�ZGd�d e�ZGd �d e�Zy) aResponse 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. �N)�addbase� addclosehook�addinfo� addinfourlc�4��eZdZdZ�fd�Zd�Zd�Zd�Z�xZS)rzOBase class for addinfo and addclosehook. Is a good idea for garbage collection.c�@��tt|� |dd��||_y)NzF)�delete)�superr�__init__�fp)�selfr � __class__s ��(/usr/lib64/python3.12/urllib/response.pyr zaddbase.__init__s!��� �g��&�r�+>�u�&�M����c�h�d|jj�dt|��d|j�d�S)N�)r�__name__�id�file�r s r�__repr__zaddbase.__repr__s(��-1�^�^�-D�-D�-/��X�t�y�y�B� Brc�H�|jjr td��|S)NzI/O operation on closed file)r �closed� ValueErrorrs r� __enter__zaddbase.__enter__s�� �7�7�>�>��;�<� <�� rc�$�|j�y�N)�close)r �type�value� tracebacks r�__exit__zaddbase.__exit__!s �� � � � r) r� __module__� __qualname__�__doc__r rrr#� __classcell__�rs@rrrs���Y�� B�� rrc�,��eZdZdZ�fd�Z�fd�Z�xZS)rz*Class to add a close hook to an open file.c�H��tt|� |�||_||_yr)r rr � closehook�hookargs)r r r+r,rs �rr zaddclosehook.__init__(s ��� �l�D�*�2�.�"��� �� rc��� |j}|j}|rd|_d|_||�tt|��y#tt|��wxYwr)r+r,r rr)r r+r,rs �rrzaddclosehook.close-sN��� .����I��}�}�H��!%��� $�� ��8�$� �,�� +� -��E�,�� +� -�s �-A�A)rr$r%r&r rr'r(s@rrr%s���4�!� .� .rrc�(��eZdZdZ�fd�Zd�Z�xZS)rz.class to add an info() method to an open file.c�:��tt|� |�||_yr)r rr �headers)r r r0rs �rr zaddinfo.__init__<s��� �g�t�%�b�)��� rc��|jSr)r0rs r�infoz addinfo.info@s ���|�|�r)rr$r%r&r r2r'r(s@rrr9s���8��rrc�@��eZdZdZd�fd� Zed��Zd�Zd�Z�xZ S)rz9class to add info() and geturl() methods to an open file.c�J��tt|� ||�||_||_yr)r rr �url�code)r r r0r5r6rs �rr zaddinfourl.__init__Gs"��� �j�$�(��W�5������ rc��|jSr�r6rs r�statuszaddinfourl.statusLs ���y�y�rc��|jSrr8rs r�getcodezaddinfourl.getcodePs ���y�y�rc��|jSr)r5rs r�geturlzaddinfourl.geturlSs ���x�x�rr) rr$r%r&r �propertyr9r;r=r'r(s@rrrDs)���C�� �����rr)r&�tempfile�__all__�_TemporaryFileWrapperrrrr�rr�rCsJ���� >���h�,�,��..�7�.�(�g����r