ó r2Wc@s*ddlmZdefd„ƒYZdS(iÿÿÿÿ(tBytesIOtCallbackFileWrappercBs5eZdZd„Zd„Zd„Zdd„ZRS(sv 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. cCs"tƒ|_||_||_dS(N(Rt_CallbackFileWrapper__buft_CallbackFileWrapper__fpt_CallbackFileWrapper__callback(tselftfptcallback((sH/usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/filewrapper.pyt__init__s  cCs|jdƒ}t||ƒS(NR(t__getattribute__tgetattr(RtnameR((sH/usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/filewrapper.pyt __getattr__s cCsNy|jjdkSWntk r'nXy|jjSWntk rInXtS(N(RRtNonetAttributeErrortclosedtFalse(R((sH/usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/filewrapper.pyt__is_fp_closed!s  cCs`|jj|ƒ}|jj|ƒ|jƒr\|jrP|j|jjƒƒnd|_n|S(N(RtreadRtwritet"_CallbackFileWrapper__is_fp_closedRtgetvalueR (Rtamttdata((sH/usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/filewrapper.pyR0s   N(t__name__t __module__t__doc__RR RR R(((sH/usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/filewrapper.pyRs    N(tioRtobjectR(((sH/usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/filewrapper.pyts