HEX
Server: LiteSpeed
System: Linux us-phx-web629.main-hosting.eu 5.14.0-503.23.2.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Feb 12 05:52:18 EST 2025 x86_64
User: u756937133 (756937133)
PHP: 8.2.30
Disabled: passthru,chgrp
Upload Files
File: //proc/2863166/root/usr/lib/python3.9/site-packages/tuned/ppd/__pycache__/config.cpython-39.pyc
a

�Գf�
�@sRddlmZmZddlmZddlZdZdZdZdZ	dZ
d	Zd
ZGdd�d�Z
dS)
�)�ConfigParser�Error)�TunedExceptionNzpower-saverZperformance�mainZprofilesZbattery�default�battery_detectionc@sXeZdZdd�Zedd��Zedd��Zedd��Zed	d
��Zedd��Z	d
d�Z
dS)�	PPDConfigcCs|�|�dS�N)�load_from_file)�self�config_file�r
�4/usr/lib/python3.9/site-packages/tuned/ppd/config.py�__init__szPPDConfig.__init__cCs|jSr	)�_battery_detection�rr
r
rrszPPDConfig.battery_detectioncCs|jSr	)�_default_profilerr
r
r�default_profileszPPDConfig.default_profilecCs|jSr	)�
_ppd_to_tunedrr
r
r�ppd_to_tunedszPPDConfig.ppd_to_tunedcCs|jSr	)�
_tuned_to_ppdrr
r
r�tuned_to_ppdszPPDConfig.tuned_to_ppdcCs|jSr	)�_ppd_to_tuned_batteryrr
r
r�ppd_to_tuned_battery#szPPDConfig.ppd_to_tuned_batterycCs t�}tj�|�std|��z|�|�WntyJtd|��Yn0t|vr`td|��t|t�|_	t
dd�|j	��D��s�td|��tt
|j	����t|j	�kr�td|��dd	�|j	��D�|_t|j	vr�td
|��t|j	vr�td|��t|v�st|tv�r td|��|tt|_|j|j	v�rJtd
|j��t|tv�rdtd|��|j	|_|�tt�|_|j�rt|v�r�td|��t|t���D]4\}}||t��v�r�|j|t||iB|_�q�t|t���D],\}}||t��v�r�|j||iB|_�q�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�VqdSr	)�
isinstance�str)�.0Zmapped_profiler
r
r�	<genexpr>5�z+PPDConfig.load_from_file.<locals>.<genexpr>z6Invalid profile mapping in the configuration file '%s'z8Duplicate profile mapping in the configuration file '%s'cSsi|]\}}||�qSr
r
)r�k�vr
r
r�
<dictcomp>:rz,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'z?Missing battery detection option in the configuration file '%s'z6Missing battery section in the configuration file '%s')r�os�path�isfiler�readr�PROFILES_SECTION�dictr�all�values�len�set�itemsr�PPD_POWER_SAVER�PPD_PERFORMANCE�MAIN_SECTION�DEFAULT_PROFILE_OPTIONr�BATTERY_DETECTION_OPTIONrZ
getbooleanr�BATTERY_SECTION�keys)rrZcfgrZ_vr r
r
rr
'sJ


zPPDConfig.load_from_fileN)�__name__�
__module__�__qualname__r�propertyrrrrrr
r
r
r
rrs




r)Ztuned.utils.config_parserrrZtuned.exceptionsrr"r-r.r/r&r2r0r1rr
r
r
r�<module>s