<!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
<e	                 @   sX   d dl mZ d dlT ddlZddlZddlZddlmZ ej	j
 ZG dd dejZdS )   )base)*    N)ACPI_DIRc                   sv   e Zd ZdZ fddZedd Zdd Zdd	 Zed
d Z	edd Z
eddd ZeddddZ  ZS )
ACPIPlugina>  
	`acpi`::

	Configures the ACPI driver.
	+
	The only currently supported option is
	[option]`platform_profile`, which sets the ACPI
	platform profile sysfs attribute,
	a generic power/performance preference API for other drivers.
	Multiple profiles can be specified, separated by `|`.
	The first available profile is selected.
	+
	--
	.Selecting a platform profile
	====
	----
	[acpi]
	platform_profile=balanced|low-power
	----
	Using this option, *TuneD* will try to set the platform profile
	to `balanced`. If that fails, it will try to set it to `low-power`.
	====
	--
	c                s   t t| j|| d S )N)superr   __init__)selfargskwargs)	__class__ !/usr/lib/python3.6/plugin_acpi.pyr   $   s    zACPIPlugin.__init__c             C   s   dd iS )Nplatform_profiler   )clsr   r   r   _get_config_options'   s    zACPIPlugin._get_config_optionsc             C   s   d|_ d|_d S )NTF)Z_has_static_tuningZ_has_dynamic_tuning)r	   instancer   r   r   _instance_init+   s    zACPIPlugin._instance_initc             C   s   d S )Nr   )r	   r   r   r   r   _instance_cleanup/   s    zACPIPlugin._instance_cleanupc             C   s   t jjtdS )NZplatform_profile_choices)ospathjoinr   )r   r   r   r   _platform_profile_choices_path2   s    z)ACPIPlugin._platform_profile_choices_pathc             C   s   t jjtdS )Nr   )r   r   r   r   )r   r   r   r   _platform_profile_path6   s    z!ACPIPlugin._platform_profile_pathr   c             C   s   t jj| j stjd d S dd |jdD }t| jj	| j
 j }xZ|D ]R}||kr|stjd|  | jj| j ||rtjgndd |S tjd|  qPW tjd	 d S )
Nz5ACPI platform_profile is not supported on this systemc             S   s   g | ]}|j  qS r   )strip).0profiler   r   r   
<listcomp>?   s    z4ACPIPlugin._set_platform_profile.<locals>.<listcomp>|z Setting platform_profile to '%s'F)Zno_errorz+Requested platform_profile '%s' unavailablezDFailed to set platform_profile. Is the value in the profile correct?)r   r   isfiler   logdebugsplitset_cmd	read_filer   infoZwrite_to_fileerrnoENOENTwarnerror)r	   ZprofilesZsimremoveZavail_profilesr   r   r   r   _set_platform_profile:   s    


z ACPIPlugin._set_platform_profileFc             C   s2   t jj| j stjd d S | jj| j j S )Nz5ACPI platform_profile is not supported on this system)	r   r   r   r   r    r!   r$   r%   r   )r	   Zignore_missingr   r   r   _get_platform_profileL   s    
z ACPIPlugin._get_platform_profile)F)__name__
__module____qualname____doc__r   classmethodr   r   r   r   r   Zcommand_setr,   Zcommand_getr-   __classcell__r   r   )r   r   r      s   r   ) r   Z
decoratorsr   r'   Z
tuned.logsZtunedZtuned.constsr   Zlogsgetr    ZPluginr   r   r   r   r   <module>   s   
