o aiå ã@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 ú–/builddir/build/BUILDROOT/alt-python310-pip-21.3.1-5.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_vendor/cachecontrol/filewrapper.pyÚ__init__s zCallbackFileWrapper.__init__cCs| d¡}t||ƒS)Nr)Ú__getattribute__Úgetattr)rÚnamer r r r Ú __getattr__s zCallbackFileWrapper.__getattr__cCsBz|jjduWStyYnwz|jjWSty YdSw)NF)rr ÚAttributeErrorÚclosed©rr r r Ú__is_fp_closed!s ÿ  ûz"CallbackFileWrapper.__is_fp_closedcCs |jr | |j ¡¡d|_dSr)rrÚgetvaluerr r r Ú_close2s zCallbackFileWrapper._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_readr) Ú__name__Ú __module__Ú __qualname__Ú__doc__r rrrrrr r r r rs   rN)ÚiorÚobjectrr r r r Ús