HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //lib/python3.9/site-packages/tuned/ppd/__pycache__/config.cpython-39.pyc
a

,�g��@shddlmZmZddlmZddlZdZdZdZdZ	dZ
d	Zd
ZdZ
dZGd
d�d�ZGdd�d�ZdS)�)�ConfigParser�Error)�TunedExceptionNzpower-saverZbalancedZperformance�main�profilesZbattery�default�battery_detection�thinkpad_function_keysc@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	edd
��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.
        )�_thinkpad_function_keysrrrrr	Msz PPDConfig.thinkpad_function_keyscCs2t�}tj�|�std|��z|�|�WntyJtd|��Yn0t|vr`td|��t|t�}t	|vr�td|��t
|vr�td|��t|vr�td|��t|vs�t
|tvr�t
|_n|tt
|_|j|vr�td|j��|jttt|vd�|_|j�rt|v�rtd	|��|j�r6|t|t�Bn|}t|���t|���Bt|j���}|�rxtd
d�|���t|���t|���}|�r�tdd�|���tt|����t|�k�s�tt|����t|�k�r�td
|��t||�|_tdd�|��D�dd�|��D��|_|jttdd�|_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>FN) 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$�THINKPAD_FUNCTION_KEYS_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