<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
3
<eQ	                 @   sJ   d dl mZmZ d dlmZ d dlZdZdZdZdZ	dZ
G d	d
 d
ZdS )    )ConfigParserError)TunedExceptionNzpower-saverZperformancemainZprofilesdefaultc               @   s@   e Zd Zdd Zedd Zedd Zedd Zd	d
 ZdS )	PPDConfigc             C   s   | j | d S )N)load_from_file)selfconfig_file r   /usr/lib/python3.6/config.py__init__   s    zPPDConfig.__init__c             C   s   | j S )N)_default_profile)r	   r   r   r   default_profile   s    zPPDConfig.default_profilec             C   s   | j S )N)_ppd_to_tuned)r	   r   r   r   ppd_to_tuned   s    zPPDConfig.ppd_to_tunedc             C   s   | j S )N)_tuned_to_ppd)r	   r   r   r   tuned_to_ppd   s    zPPDConfig.tuned_to_ppdc             C   sR  t  }tjj|std| y|j| W n  tk
rL   td| Y nX t|krbtd| t|t | _	t
dd | j	j D std| tt| j	j t| j	krtd| dd	 | j	j D | _t| j	krtd
| t| j	kr td| t|kst|t kr$td| |t t | _| j| j	krNtd| j 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  qd S )N)
isinstancestr).0Zmapped_profiler   r   r   	<genexpr>+   s    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 | ]\}}||qS r   r   )r   kvr   r   r   
<dictcomp>0   s    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'zUnknown 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
   Zcfgr   r   r   r      s0    
zPPDConfig.load_from_fileN)	__name__
__module____qualname__r   propertyr   r   r   r   r   r   r   r   r      s
   r   )Ztuned.utils.config_parserr   r   Ztuned.exceptionsr   r   r&   r'   r(   r   r)   r   r   r   r   r   <module>   s   