Server IP : 149.255.58.128 / Your IP : 216.73.216.21
System : Linux cloud516.thundercloud.uk 5.14.0-427.26.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 17 15:51:13 EDT 2024 x86_64
PHP Version : 8.2.28
Disable Function : allow_url_include, apache_child_terminate, apache_setenv, exec, passthru, pcntl_exec, posix_kill, posix_mkfifo, posix_getpwuid, posix_setpgid, posix_setsid, posix_setuid, posix_setgid, posix_seteuid, posix_setegid, posix_uname, proc_close, proc_get_status, proc_open, proc_terminate, shell_exec, show_source, system
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Upload Files :
Command :
Current File : /usr/lib/python3.9/site-packages/tuned/ppd/__pycache__//config.cpython-39.opt-1.pyc
a
�Գf�
� @ sR d dl mZmZ d dlmZ d dlZdZdZdZdZ dZ
d Zd
ZG dd� d�Z
dS )
� )�ConfigParser�Error)�TunedExceptionNzpower-saverZperformance�mainZprofilesZbattery�default�battery_detectionc @ sX e Zd Zdd� Zedd� �Zedd� �Zedd� �Zed d
� �Zedd� �Z d
d� Z
dS )� PPDConfigc C s | � |� d S �N)�load_from_file)�self�config_file� r
�4/usr/lib/python3.9/site-packages/tuned/ppd/config.py�__init__ s zPPDConfig.__init__c C s | j S r )�_battery_detection�r r
r
r r s zPPDConfig.battery_detectionc C s | j S r )�_default_profiler r
r
r �default_profile s zPPDConfig.default_profilec C s | j S r )�
_ppd_to_tunedr r
r
r �ppd_to_tuned s zPPDConfig.ppd_to_tunedc C s | j S r )�
_tuned_to_ppdr r
r
r �tuned_to_ppd s zPPDConfig.tuned_to_ppdc C s | j S r )�_ppd_to_tuned_batteryr r
r
r �ppd_to_tuned_battery# s zPPDConfig.ppd_to_tuned_batteryc C s t � }tj�|�std| ��z|�|� W n tyJ td| ��Y n0 t|vr`td| ��t|t �| _ t
dd� | j �� D ��s�td| ��tt
| j �� ��t| j �kr�td| ��dd � | j �� D �| _t| j vr�td
| ��t| j vr�td| ��t|v�st|t v�r td| ��|t t | _| j| j v�rJtd
| j ��t|t v�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�d S )Nz&Configuration file '%s' does not existz)Error parsing the configuration file '%s'z7Missing profiles section in the configuration file '%s'c s s | ]}t |t�V qd S r )�
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'c S s i | ]\}}||�qS r
r
)r �k�vr
r
r �
<dictcomp>: r z,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_OPTIONr Z
getbooleanr �BATTERY_SECTION�keys)r r Zcfgr Z_vr r
r
r r
'