Sindbad~EG File Manager

Current Path : /lib/python3.6/site-packages/pip/_vendor/cachecontrol/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/pip/_vendor/cachecontrol/__pycache__/filewrapper.cpython-36.pyc

3

�Pf�	�@s ddlmZGdd�de�ZdS)�)�BytesIOc@sBeZdZdZdd�Zdd�Zdd�Zdd	�Zddd�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
�!/usr/lib/python3.6/filewrapper.py�__init__szCallbackFileWrapper.__init__cCs|jd�}t||�S)Nr)�__getattribute__�getattr)r�namerr
r
r�__getattr__s	
zCallbackFileWrapper.__getattr__cCsDy|jjdkStk
r YnXy|jjStk
r>YnXdS)NF)rr�AttributeError�closed)rr
r
rZ__is_fp_closed!sz"CallbackFileWrapper.__is_fp_closedcCs |jr|j|jj��d|_dS)N)rr�getvalue)rr
r
r�_close0szCallbackFileWrapper._closeNcCs,|jj|�}|jj|�|j�r(|j�|S)N)r�readr�write�"_CallbackFileWrapper__is_fp_closedr)r�amt�datar
r
rr;s
zCallbackFileWrapper.readcCs@|jj|�}|dkr |dkr |S|jj|�|j�r<|j�|S)N�s
)r�
_safe_readrrrr)rrrr
r
rrCszCallbackFileWrapper._safe_read)N)
�__name__�
__module__�__qualname__�__doc__rrrrrrr
r
r
rrs

rN)�ior�objectrr
r
r
r�<module>s

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists