관리-도구
편집 파일: filewrapper.cpython-312.pyc
� G��e� � �\ � d dl mZ d dlZd dlmZ d dlmZmZmZ erd dl m Z G d� d� Zy)� )�annotationsN)�NamedTemporaryFile)� TYPE_CHECKING�Any�Callable)�HTTPResponsec �N � e Zd ZdZ d d�Zd d�Zdd�Zdd�Zd dd�Zdd�Z y)�CallbackFileWrappera 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. The data is stored in a temporary file until it is all available. As long as the temporary files directory is disk-based (sometimes it's a memory-backed-``tmpfs`` on Linux), data will be unloaded to disk if memory pressure is high. For small files the disk usually won't be used at all, it'll all be in the filesystem memory cache, so there should be no performance impact. c �D � t dd�� | _ || _ || _ y )Nzrb+T)�delete)r �_CallbackFileWrapper__buf�_CallbackFileWrapper__fp�_CallbackFileWrapper__callback)�self�fp�callbacks ��/builddir/build/BUILDROOT/alt-python312-pip-23.3.1-1.el8.x86_64/opt/alt/python312/lib/python3.12/site-packages/pip/_vendor/cachecontrol/filewrapper.py�__init__zCallbackFileWrapper.__init__! s � � (��d�;�� ��� �"��� c �<