zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
U
H=®då    ã@s ddlmZGdd„deƒZdS)é)ÚBytesIOc@sBeZdZdZdd„Zdd„Zdd„Zdd    „Zdd d „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.
    cCstƒ|_||_||_dS©N)rÚ_CallbackFileWrapper__bufÚ_CallbackFileWrapper__fpÚ_CallbackFileWrapper__callback)ÚselfÚfpÚcallback©r ú[D:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\pip/_vendor/cachecontrol/filewrapper.pyÚ__init__szCallbackFileWrapper.__init__cCs| d¡}t||ƒS)Nr)Ú__getattribute__Úgetattr)rÚnamer    r r r Ú __getattr__s    
zCallbackFileWrapper.__getattr__cCsHz|jjdkWStk
r"YnXz
|jjWStk
rBYnXdS)NF)rr    ÚAttributeErrorÚclosed©rr r r Ú__is_fp_closed!s
z"CallbackFileWrapper.__is_fp_closedcCs |jr| |j ¡¡d|_dSr)rrÚgetvaluerr r r Ú_close2szCallbackFileWrapper._closeNcCs,|j |¡}|j |¡| ¡r(| ¡|Sr)rÚreadrÚwriteÚ"_CallbackFileWrapper__is_fp_closedr©rÚamtÚdatar r r r=s
  zCallbackFileWrapper.readcCs@|j |¡}|dkr |dkr |S|j |¡| ¡r<| ¡|S)Nés
)rÚ
_safe_readrrrrrr r r rEs  zCallbackFileWrapper._safe_read)N)
Ú__name__Ú
__module__Ú __qualname__Ú__doc__r rrrrrr r r r rs  
rN)ÚiorÚobjectrr r r r Ú<module>s