Your IP : 18.225.54.199


Current Path : /usr/lib/python3.6/site-packages/tuned/storage/__pycache__/
Upload File :
Current File : //usr/lib/python3.6/site-packages/tuned/storage/__pycache__/pickle_provider.cpython-36.pyc

3

�<�e��@sNddlmZddlZddlZddlZddljZejj	�Z
Gdd�dej�ZdS)�)�
interfaces�Nc@sPeZdZddgZddd�Zdd�Zddd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dS)�PickleProvider�_path�_dataNcCs|dkrtj}||_i|_dS)N)�constsZDEFAULT_STORAGE_FILErr)�self�path�r
�%/usr/lib/python3.6/pickle_provider.py�__init__szPickleProvider.__init__cCs |jj|i�||j||<dS)N)r�
setdefault)r�	namespace�option�valuer
r
r�setszPickleProvider.setcCs |jj|i�|j|j||�S)N)rr
�get)rrr�defaultr
r
rrszPickleProvider.getcCs,|jj|i�||j|kr(|j||=dS)N)rr
)rrrr
r
r�unsetszPickleProvider.unsetcCs~y>tjdt|j��t|jd��}tj|j|�WdQRXWn:tt	fk
rx}ztj
d|j|f�WYdd}~XnXdS)Nz	Saving %s�wbz"Error saving storage file '%s': %s)�log�debug�strr�openr�pickle�dump�OSError�IOError�error)r�f�er
r
r�saveszPickleProvider.savecCs�y(t|jd��}tj|�|_WdQRXWnXttfk
rh}z tjd|j|f�i|_WYdd}~Xnt	k
r�i|_YnXdS)N�rbz#Error loading storage file '%s': %s)
rrr�loadrrrrr�EOFError)rrr r
r
rr#'szPickleProvider.loadcCsZ|jj�ytj|j�Wn:ttfk
rT}ztjd|j|f�WYdd}~XnXdS)Nz$Error removing storage file '%s': %s)	r�clear�os�unlinkrrrrr)rr r
r
rr%1s

zPickleProvider.clear)N)N)�__name__�
__module__�__qualname__�	__slots__rrrrr!r#r%r
r
r
rr	s


r)
�rZ
tuned.logsZtunedrr&Ztuned.constsrZlogsrrZProviderrr
r
r
r�<module>s



?>