JFIF$        dd7 

Viewing File: /usr/lib/python3.9/site-packages/tuned/ppd/__pycache__/config.cpython-39.opt-1.pyc

a

���h��@shddlmZmZddlmZddlZdZdZdZdZ	dZ
d	Zd
ZdZ
dZGd
d�d�ZGdd�d�ZdS)�)�ConfigParser�Error)�TunedExceptionNzpower-saverZbalancedZperformance�main�profilesZbattery�default�battery_detection�sysfs_acpi_monitorc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�
ProfileMapzB
    Mapping of PPD profiles to TuneD profiles or vice versa.
    cCs||_||_dS�N)�_ac_map�_dc_map)�selfZac_mapZdc_map�r�4/usr/lib/python3.9/site-packages/tuned/ppd/config.py�__init__szProfileMap.__init__cCs|r
|jn|j}||S)z�
        Returns a TuneD profile corresponding to the given
        PPD profile and power supply status (or vice versa).
        )r
r)rZprofile�
on_battery�profile_maprrr�getszProfileMap.getcCs|r
|jn|j}|��S)z>
        Returns the supported PPD or TuneD profiles.
        )r
r�keys)rrrrrrr!szProfileMap.keysN)�__name__�
__module__�__qualname__�__doc__rrrrrrrr
sr
c@s\eZdZdZdd�Zedd��Zedd��Zedd	��Zed
d��Z	edd
��Z
dd�ZdS)�	PPDConfigz1
    Configuration for the tuned-ppd daemon.
    cCs||_|�|�dSr)�_tuned_interface�load_from_file)r�config_fileZtuned_interfacerrrr-szPPDConfig.__init__cCs|jS)z7
        Whether battery detection is enabled.
        )�_battery_detection�rrrrr1szPPDConfig.battery_detectioncCs|jS)zC
        Default PPD profile to set during initialization.
        )�_default_profilerrrr�default_profile8szPPDConfig.default_profilecCs|jS)z<
        Mapping of PPD profiles to TuneD profiles.
        )�
_ppd_to_tunedrrrr�ppd_to_tuned?szPPDConfig.ppd_to_tunedcCs|jS)z<
        Mapping of TuneD profiles to PPD profiles.
        )�
_tuned_to_ppdrrrr�tuned_to_ppdFszPPDConfig.tuned_to_ppdcCs|jS)z�
        Whether to react to changes of ACPI platform profile
        done via function keys (e.g., Fn-L) on newer Thinkpad
        machines. Experimental feature.
        )�_sysfs_acpi_monitorrrrrr	MszPPDConfig.sysfs_acpi_monitorcCs2t�}tj�|�std|��z|�|�WntyJtd|��Yn0t|vr`td|��t|t�}t	|vr�td|��t
|vr�td|��t|vr�td|��t|vs�t
|tvr�t
|_n|tt
|_|j|vr�td|j��|jttt|vd�|_|j�rt|v�rtd	|��|j�r6|t|t�Bn|}t|���t|���Bt|j���}|�rxtd
d�|���t|���t|���}|�r�tdd�|���tt|����t|�k�s�tt|����t|�k�r�td
|��t||�|_tdd�|��D�dd�|��D��|_|jttdd�|_dS)zA
        Loads the configuration from the provided file.
        z&Configuration file '%s' does not existz)Error parsing the configuration file '%s'z7Missing profiles section in the configuration file '%s'z:Missing power-saver profile in the configuration file '%s'z7Missing balanced profile in the configuration file '%s'z:Missing performance profile in the configuration file '%s'z3Default profile '%s' missing in the profile mapping)�fallbackz6Missing battery section in the configuration file '%s'z2Unknown TuneD profiles in the configuration file: z, z-Unknown PPD profiles in the battery section: z8Duplicate profile mapping in the configuration file '%s'cSsi|]\}}||�qSrr)�.0�k�vrrr�
<dictcomp>��z,PPDConfig.load_from_file.<locals>.<dictcomp>TN) r�os�path�isfiler�readr�PROFILES_SECTION�dict�PPD_POWER_SAVER�PPD_BALANCED�PPD_PERFORMANCE�MAIN_SECTION�DEFAULT_PROFILE_OPTIONr Z
getboolean�BATTERY_DETECTION_OPTION�BATTERY_SECTIONr�set�valuesrr�joinr�lenr
r"�itemsr$�SYSFS_ACPI_MONITOR_OPTIONr&)rrZcfgZprofile_dict_acZprofile_dict_dcZunknown_tuned_profilesZunknown_battery_profilesrrrrVsH
&4(zPPDConfig.load_from_fileN)rrrrr�propertyrr!r#r%r	rrrrrr)s




r)Ztuned.utils.config_parserrrZtuned.exceptionsrr-r3r4r5r6r1r9r7r8r?r
rrrrr�<module>s
Back to Directory  nL+D550H?Mx ,D"v]qv;6*Zqn)ZP0!1 A "#a$2Qr D8 a Ri[f\mIykIw0cuFcRı?lO7к_f˓[C$殷WF<_W ԣsKcëIzy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