| Server IP : 185.143.234.130 / Your IP : 185.215.232.195 Web Server : LiteSpeed System : Linux jambul.7ho.st 5.14.0-503.40.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Mon May 5 06:06:04 EDT 2025 x86_64 User : renecafe ( 1327) PHP Version : 8.1.33 Disable Function : show_source, system, shell_exec, passthru, exec, popen, proc_open MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/lib/python3.9/site-packages/pip/_vendor/cachecontrol/__pycache__/ |
Upload File : |
a
[��f� � @ s d dl mZ G dd� de�ZdS )� )�BytesIOc @ sB e Zd ZdZdd� Zdd� Zdd� Zdd � Zddd�Zd
d� Z d
S )�CallbackFileWrapperav
Small wrapper around a fp object which will tee everything read into a
buffer, and when that file is closed it will execute a callback with the
contents of that buffer.
All attributes are proxied to the underlying file object.
This class uses members with a double underscore (__) leading prefix so as
not to accidentally shadow an attribute.
c C s t � | _|| _|| _d S �N)r �_CallbackFileWrapper__buf�_CallbackFileWrapper__fp�_CallbackFileWrapper__callback)�self�fp�callback� r �H/usr/lib/python3.9/site-packages/pip/_vendor/cachecontrol/filewrapper.py�__init__ s zCallbackFileWrapper.__init__c C s | � d�}t||�S )Nr )�__getattribute__�getattr)r �namer r r r �__getattr__ s
zCallbackFileWrapper.__getattr__c C sD z| j jd u W S ty Y n0 z
| j jW S ty> Y n0 dS )NF)r r �AttributeError�closed�r r r r Z__is_fp_closed! s
z"CallbackFileWrapper.__is_fp_closedc C s | j r| � | j�� � d | _ d S r )r r �getvaluer r r r �_close2 s zCallbackFileWrapper._closeNc C s, | j �|�}| j�|� | �� r(| �� |S r )r �readr �write�"_CallbackFileWrapper__is_fp_closedr �r Zamt�datar r r r = s
zCallbackFileWrapper.readc C s@ | j �|�}|dkr |dkr |S | j�|� | �� r<| �� |S )N� s
)r �
_safe_readr r r r r r r r r E s zCallbackFileWrapper._safe_read)N)
�__name__�
__module__�__qualname__�__doc__r
r r r r r r r r r r s
r N)�ior �objectr r r r r �<module> s