idj6ddlmZddlZGddeZdS))NamedTemporaryFileNc8eZdZdZdZdZdZdZd dZdZ dS) 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. cNtdd|_||_||_dS)Nzrb+T)delete)r_CallbackFileWrapper__buf_CallbackFileWrapper__fp_CallbackFileWrapper__callback)selffpcallbacks Y/opt/cloudlinux/venv/lib/python3.11/site-packages/pip/_vendor/cachecontrol/filewrapper.py__init__zCallbackFileWrapper.__init__s('d;;;  "cL|d}t||S)Nr )__getattribute__getattr)r namer s r __getattr__zCallbackFileWrapper.__getattr__!s( " "#= > >r4   rc~ |jjduS#t$rYnwxYw |jjS#t$rYnwxYwdS)NF)r r AttributeErrorclosed)r s r__is_fp_closedz"CallbackFileWrapper.__is_fp_closed-sm 9<4' '    D  9# #    D  us   - ::c~|jr|jdkrd}n`|jddt t j|jdt j}||d|_|jdS)Nrr)access) r rtellseek memoryviewmmapfileno ACCESS_READclose)r results r_closezCallbackFileWrapper._close>s ? $z  A%%  1%%%#Idj//111T=MNNN OOF # # # rNc|j|}|r|j||r||SN)r readrwrite"_CallbackFileWrapper__is_fp_closedr$r amtdatas rr'zCallbackFileWrapper.readYs[y~~c""  # J  T " " "      KKMMM rc|j|}|dkr|dkr|S|j||r||S)Ns )r _safe_readrr(r)r$r*s rr/zCallbackFileWrapper._safe_readdsky##C(( !88K       KKMMM rr&) __name__ __module__ __qualname____doc__rrr)r$r'r/rrrr s}$### ! ! !"6         rr)tempfilerrobjectrr4rrr7s` (''''' fffff&fffffr