Edit File: response.cpython-37.opt-1.pyc
B ����p}�c�������������������@���s^���d�Z�ddlZddddgZG�dd��dej�ZG�dd��de�ZG�d d��de�ZG�d d��de�ZdS�)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. �����N�addbase�addclosehook�addinfo� addinfourlc�������������������s8���e�Zd�ZdZ��fdd�Zdd��Zdd��Zdd ��Z���ZS�) r���zOBase class for addinfo and addclosehook. Is a good idea for garbage collection.c����������������s ���t�t|��j|ddd��||�_d�S�)Nz<urllib response>F)�delete)�superr����__init__�fp)�selfr ���)� __class__���4/opt/alt/python37/lib64/python3.7/urllib/response.pyr������s����zaddbase.__init__c�������������C���s���d|�j�jt|��|�jf�S�)Nz<%s at %r whose fp = %r>)r����__name__�id�file)r ���r���r���r ����__repr__���s����zaddbase.__repr__c�������������C���s���|�j�jrtd��|�S�)NzI/O operation on closed file)r ����closed� ValueError)r ���r���r���r ���� __enter__���s����zaddbase.__enter__c�������������C���s���|������d�S�)N)�close)r ����type�value� tracebackr���r���r ����__exit__!���s����zaddbase.__exit__) r���� __module__�__qualname__�__doc__r���r���r���r���� __classcell__r���r���)r���r ���r������s ���c�������������������s,���e�Zd�ZdZ��fdd�Z��fdd�Z���ZS�)r���z*Class to add a close hook to an open file.c����������������s ���t�t|���|��||�_||�_d�S�)N)r���r���r���� closehook�hookargs)r ���r ���r���r���)r���r���r ���r���(���s����zaddclosehook.__init__c���������� ������s>���z(|�j�}|�j}|r&d�|�_�d�|�_||���W�d�tt|������X�d�S�)N)r���r���r���r���r���)r ���r���r���)r���r���r ���r���-���s����zaddclosehook.close)r���r���r���r���r���r���r���r���r���)r���r ���r���%���s���c�������������������s(���e�Zd�ZdZ��fdd�Zdd��Z���ZS�)r���z.class to add an info() method to an open file.c����������������s���t�t|���|��||�_d�S�)N)r���r���r����headers)r ���r ���r ���)r���r���r ���r���<���s����zaddinfo.__init__c�������������C���s���|�j�S�)N)r ���)r ���r���r���r ����info@���s����zaddinfo.info)r���r���r���r���r���r!���r���r���r���)r���r ���r���9���s���c�������������������s2���e�Zd�ZdZd ��fdd� Zdd��Zdd��Z���ZS�) r���z9class to add info() and geturl() methods to an open file.Nc����������������s"���t�t|���||��||�_||�_d�S�)N)r���r���r����url�code)r ���r ���r ���r"���r#���)r���r���r ���r���G���s����zaddinfourl.__init__c�������������C���s���|�j�S�)N)r#���)r ���r���r���r ����getcodeL���s����zaddinfourl.getcodec�������������C���s���|�j�S�)N)r"���)r ���r���r���r ����geturlO���s����zaddinfourl.geturl)N)r���r���r���r���r���r$���r%���r���r���r���)r���r ���r���D���s���)r���Ztempfile�__all__Z_TemporaryFileWrapperr���r���r���r���r���r���r���r ����<module>���s���