Files
intellecton/venv/lib/python3.12/site-packages/cachecontrol/__pycache__/filewrapper.cpython-312.pyc
T

38 lines
4.3 KiB
Plaintext
Raw Normal View History

Ë
jãóhddlmZddlZddlmZddlmZmZmZer ddl m
Z
ddl m Z Gdd«Z
y) é)Ú annotationsN)ÚNamedTemporaryFile)Ú
TYPE_CHECKINGÚAnyÚCallable)ÚBuffer)Ú HTTPResponsecóNeZdZdZ d dZd
dZd dZd dZd
ddZddZ 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óDtdd¬«|_||_||_y)Nzrb+T)Údelete)rÚ_CallbackFileWrapper__bufÚ_CallbackFileWrapper__fpÚ_CallbackFileWrapper__callback)ÚselfÚfpÚcallbacks ú[/home/antigravity/intellecton/venv/lib/python3.12/site-packages/cachecontrol/filewrapper.pyÚ__init__zCallbackFileWrapper.__init__"s ô°dÔŒ
؈Œ Ø"ˆócó<|jd«}t||«S)Nr)Ú__getattribute__Úgetattr)rÚnamers rÚ __getattr__zCallbackFileWrapper.__getattr__)s"ð×
"Ð#=Ó
>ˆÜr˜ Ð rcó¢ |jjduS#t$rYnwxYw |jj}|S#t$rYywxYw)NF)rrÚAttributeErrorÚclosed)rrs rÚ__is_fp_closedz"CallbackFileWrapper.__is_fp_closed5s\ð Ø—99—<<  'øäò Ù ð úð ØŸ9™9×+ˆF؈Møäò Ø ðð  úsš &¥&ªAÁ AÁ
Acó†|jr”|jj«dk(rd}nc|jjdd«t t j
|jj
«dt
j¬««}|j|«d|_|jj«y)Nrr)Úaccess) rrÚtellÚseekÚ
memoryviewÚmmapÚfilenoÚ ACCESS_READÚclose)rÚresults rÚ_closezCallbackFileWrapper._closeGsà ?Š?Øz‰zÓ  AÒð 
  1Ô—I‘I˜dŸj™j×1°1¼T×=MÑ=MÔð
O‰O˜FÔ ˆŒð