/usr/lib/python3.9/site-packages/tuned/ppd/__pycache__
Edit: /usr/lib/python3.9/site-packages/tuned/ppd/__pycache__/config.cpython-39.pyc (4963B)
a
Á]›i² ã @ sh d dl mZmZ d dlmZ d dlZdZdZdZdZ dZ
d Zd
ZdZ
dZG d
d„ dƒZG dd„ dƒZdS )é )ÚConfigParserÚError)ÚTunedExceptionNzpower-saverZbalancedZperformanceÚmainÚprofilesZbatteryÚdefaultÚbattery_detectionÚsysfs_acpi_monitorc @ s( e Zd ZdZdd„ Zdd„ Zdd„ ZdS ) Ú
ProfileMapzB
Mapping of PPD profiles to TuneD profiles or vice versa.
c C s || _ || _d S ©N)Ú_ac_mapÚ_dc_map)ÚselfZac_mapZdc_map© r ú4/usr/lib/python3.9/site-packages/tuned/ppd/config.pyÚ__init__ s zProfileMap.__init__c C s |r
| j n| j}|| S )z�
Returns a TuneD profile corresponding to the given
PPD profile and power supply status (or vice versa).
)r
r )r ZprofileÚ
on_batteryÚprofile_mapr r r Úget s zProfileMap.getc C s |r
| j n| j}| ¡ S )z>
Returns the supported PPD or TuneD profiles.
)r
r Úkeys)r r r r r r r ! s zProfileMap.keysN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r r r r r r r r
s r
c @ s\ e Zd ZdZdd„ Zedd„ ƒZedd„ ƒZedd „ ƒZed
d„ ƒZ edd
„ ƒZ
dd„ ZdS )Ú PPDConfigz1
Configuration for the tuned-ppd daemon.
c C s || _ | |¡ d S r )Ú_tuned_interfaceÚload_from_file)r Úconfig_fileZtuned_interfacer r r r - s zPPDConfig.__init__c C s | j S )z7
Whether battery detection is enabled.
)Ú_battery_detection©r r r r r 1 s zPPDConfig.battery_detectionc C s | j S )zC
Default PPD profile to set during initialization.
)Ú_default_profiler r r r Údefault_profile8 s zPPDConfig.default_profilec C s | j S )z<
Mapping of PPD profiles to TuneD profiles.
)Ú
_ppd_to_tunedr r r r Úppd_to_tuned? s zPPDConfig.ppd_to_tunedc C s | j S )z<
Mapping of TuneD profiles to PPD profiles.
)Ú
_tuned_to_ppdr r r r Útuned_to_ppdF s zPPDConfig.tuned_to_ppdc C s | j S )z¬
Whether to react to changes of ACPI platform profile
done via function keys (e.g., Fn-L) on newer Thinkpad
machines. Experimental feature.
)Ú_sysfs_acpi_monitorr r r r r M s zPPDConfig.sysfs_acpi_monitorc C s2 t ƒ }tj |¡std| ƒ‚z| |¡ W n tyJ td| ƒ‚Y n0 t|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 ƒ‚|jttt|v d�| _| j�rt|v�rtd | ƒ‚| j�r6|t|t ƒB n|}t| ¡ ƒt| ¡ ƒB t| j ¡ ƒ }|�rxtd
d |¡ ƒ‚t| ¡ ƒt| ¡ ƒ }|�r¨tdd |¡ ƒ‚tt| ¡ ƒƒt|ƒk�sÜtt| ¡ ƒƒt|ƒk�rètd
| ƒ‚t||ƒ| _tdd„ | ¡ D ƒdd„ | ¡ D ƒƒ| _|jttdd�| _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'c S s i | ]\}}||“qS r r )Ú.0ÚkÚvr r r Ú
Ž ó z,PPDConfig.load_from_file..TN) 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Úvaluesr r Újoinr Úlenr
r" Úitemsr$ ÚSYSFS_ACPI_MONITOR_OPTIONr&