£Á°èZ¨Ä…–K§‚«“ô4“ÒÙ´dîfUÙÃÅ WKbyÊ¦•êŽ…È®FÒ¿ÊÎóCozá¬S@6{Í:›œêZÌ:Š•_%:¢¾¾~;‘Ã~èŠ©ÊÇí`ÔÑ©úë™µ'5I¿fš×WO%ø9¾«¾DK|€ùÍD”Ýs]nHÕ¶ê×Ó¼ãžªéUWŸÈË%DÒÕ¬ï‘]/Åcx  ‰ï2ß]ä6G[]S£ÔÏ¯rs{úëóµmÒï#UQxo·õÞCe]"±/aÙ&Eã4ú9Jé_ÞåëdãöKë)AÞ                  ¯¹ægƒÛowÐø^d™ý½ßB7áyMä9ÜÖUã
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<html>
3
<e                 @   sT   d dl mZ d dl mZ ddlZddlmZ ddlZejj	 Z
G dd dejZdS )   )base)
exceptions    N)commandsc                   sT   e Zd ZdZ fddZedd Zdd Zdd	 Zd
d Z	dd Z
dd Z  ZS )EeePCSHEPlugina  
	`eeepc_she`::
	
	Dynamically sets the front-side bus (FSB) speed according to the
	CPU load. This feature can be found on some netbooks and is also
	known as the Asus Super Hybrid Engine. If the CPU load is lower or
	equal to the value specified by the [option]`load_threshold_powersave`
	option, the plug-in sets the FSB speed to the value specified by the
	[option]`she_powersave` option. If the CPU load is higher or
	equal to the value specified by the [option]`load_threshold_normal`
	option, it sets the FSB speed to the value specified by the
	[option]`she_normal` option. Static tuning is not supported and the
	plug-in is transparently disabled if the hardware support for this
	feature is not detected.
	
	NOTE: For details about the FSB frequencies and corresponding values, see
	link:https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-platform-eeepc-laptop[the kernel documentation].
	The provided defaults should work for most users.
	c                sP   t  | _d| _tjj| js"d| _tjj| js:tjdtt	| j
|| d S )Nz!/sys/devices/platform/eeepc/cpufvz%/sys/devices/platform/eeepc-wmi/cpufvz)Plugin is not supported on your hardware.)r   _cmd_control_fileospathisfiler   ZNotSupportedPluginExceptionsuperr   __init__)selfargskwargs)	__class__ &/usr/lib/python3.6/plugin_eeepc_she.pyr      s    
zEeePCSHEPlugin.__init__c             C   s   dddddS )Ng333333?g?   r   )load_threshold_normalload_threshold_powersaveZshe_powersaveZ
she_normalr   )r   r   r   r   _get_config_options'   s    z"EeePCSHEPlugin._get_config_optionsc             C   s&   d|_ d|_d |_| jjdd |_d S )NFTload)Z_has_static_tuningZ_has_dynamic_tuning	_she_mode_monitors_repositoryZcreate_load_monitor)r   instancer   r   r   _instance_init0   s    zEeePCSHEPlugin._instance_initc             C   s"   |j d k	r| jj|j  d |_ d S )N)r   r   delete)r   r   r   r   r   _instance_cleanup6   s    
z EeePCSHEPlugin._instance_cleanupc             C   sH   |j j d }||jd kr*| j|d n||jd krD| j|d d S )Nsystemr   Z	powersaver   normal)r   Zget_loadoptions_set_she_mode)r   r   devicer   r   r   r   _instance_update_dynamic;   s
    z'EeePCSHEPlugin._instance_update_dynamicc             C   s   | j |d d S )Nr!   )r#   )r   r   r$   r   r   r   _instance_unapply_dynamicB   s    z(EeePCSHEPlugin._instance_unapply_dynamicc             C   sL   t |jd|  }|j|krHtjd||f  | jj| jd|  || _d S )Nzshe_%sznew eeepc_she mode %s (%d) z%s)intr"   r   loginfor   Zwrite_to_filer   )r   r   Znew_modeZnew_mode_numericr   r   r   r#   F   s
    
zEeePCSHEPlugin._set_she_mode)__name__
__module____qualname____doc__r   classmethodr   r   r   r%   r&   r#   __classcell__r   r   )r   r   r   	   s   		r   ) r   r   Z
tuned.logsZtunedZtuned.utils.commandsr   r	   Zlogsgetr(   ZPluginr   r   r   r   r   <module>   s   
