Your IP : 13.59.58.68


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

3

�<�eQ	�@sJddlmZmZddlmZddlZdZdZdZdZ	dZ
Gd	d
�d
�ZdS)�)�ConfigParser�Error)�TunedExceptionNzpower-saverZperformance�mainZprofiles�defaultc@s@eZdZdd�Zedd��Zedd��Zedd��Zd	d
�ZdS)�	PPDConfigcCs|j|�dS)N)�load_from_file)�self�config_file�r�/usr/lib/python3.6/config.py�__init__szPPDConfig.__init__cCs|jS)N)�_default_profile)r	rrr�default_profileszPPDConfig.default_profilecCs|jS)N)�
_ppd_to_tuned)r	rrr�ppd_to_tunedszPPDConfig.ppd_to_tunedcCs|jS)N)�
_tuned_to_ppd)r	rrr�tuned_to_ppdszPPDConfig.tuned_to_ppdcCsRt�}tjj|�std|��y|j|�Wn tk
rLtd|��YnXt|krbtd|��t|t�|_	t
dd�|j	j�D��s�td|��tt
|j	j���t|j	�kr�td|��dd	�|j	j�D�|_t|j	kr�td
|��t|j	k�rtd|��t|k�st|tk�r$td|��|tt|_|j|j	k�rNtd
|j��dS)Nz&Configuration file '%s' does not existz)Error parsing the configuration file '%s'z7Missing profiles section in the configuration file '%s'css|]}t|t�VqdS)N)�
isinstance�str)�.0Zmapped_profilerrr�	<genexpr>+sz+PPDConfig.load_from_file.<locals>.<genexpr>z6Invalid profile mapping in the configuration file '%s'z8Duplicate profile mapping in the configuration file '%s'cSsi|]\}}||�qSrr)r�k�vrrr�
<dictcomp>0sz,PPDConfig.load_from_file.<locals>.<dictcomp>z:Missing power-saver profile in the configuration file '%s'z:Missing performance profile in the configuration file '%s'z6Missing default profile in the configuration file '%s'zUnknown default profile '%s')r�os�path�isfiler�readr�PROFILES_SECTION�dictr�all�values�len�set�itemsr�PPD_POWER_SAVER�PPD_PERFORMANCE�MAIN_SECTION�DEFAULT_PROFILE_OPTIONr)r	r
Zcfgrrrrs0
zPPDConfig.load_from_fileN)	�__name__�
__module__�__qualname__r
�propertyrrrrrrrrr
s
r)Ztuned.utils.config_parserrrZtuned.exceptionsrrr&r'r(rr)rrrrr�<module>s

?>