MOON
Server: Apache
System: Linux s5.yayogua.com.py 6.12.0-124.55.3.el10_1.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:54:02 EDT 2026 x86_64
User: sanbercountryclu (1012)
PHP: 8.2.33
Disabled: NONE
Upload Files
File: //lib/python3.12/site-packages/tuned/ppd/__pycache__/config.cpython-312.pyc
�

�]�i���t�ddlmZmZddlmZddlZdZdZdZdZ	dZ
d	Zd
ZdZ
dZGd
�d�ZGd�d�Zy)�)�ConfigParser�Error)�TunedExceptionNzpower-saver�balanced�performance�main�profiles�battery�default�battery_detection�sysfs_acpi_monitorc�"�eZdZdZd�Zd�Zd�Zy)�
ProfileMapzB
    Mapping of PPD profiles to TuneD profiles or vice versa.
    c� �||_||_y�N)�_ac_map�_dc_map)�self�ac_map�dc_maps   �5/usr/lib/python3.12/site-packages/tuned/ppd/config.py�__init__zProfileMap.__init__s��������c�@�|r|jn|j}||S)z�
        Returns a TuneD profile corresponding to the given
        PPD profile and power supply status (or vice versa).
        )rr)r�profile�
on_battery�profile_maps    r�getzProfileMap.gets ��
'1�d�l�l�d�l�l���7�#�#rc�V�|r|jn|j}|j�S)z>
        Returns the supported PPD or TuneD profiles.
        )rr�keys)rrrs   rr zProfileMap.keys!s$��'1�d�l�l�d�l�l�����!�!rN)�__name__�
__module__�__qualname__�__doc__rrr �rrrrs����$�"rrc�l�eZdZdZd�Zed��Zed��Zed��Zed��Z	ed��Z
d�Zy	)
�	PPDConfigz1
    Configuration for the tuned-ppd daemon.
    c�4�||_|j|�yr)�_tuned_interface�load_from_file)r�config_file�tuned_interfaces   rrzPPDConfig.__init__-s�� /������K�(rc��|jS)z7
        Whether battery detection is enabled.
        )�_battery_detection�rs rrzPPDConfig.battery_detection1s��
�&�&�&rc��|jS)zC
        Default PPD profile to set during initialization.
        )�_default_profiler/s r�default_profilezPPDConfig.default_profile8s��
�$�$�$rc��|jS)z<
        Mapping of PPD profiles to TuneD profiles.
        )�
_ppd_to_tunedr/s r�ppd_to_tunedzPPDConfig.ppd_to_tuned?���
�!�!�!rc��|jS)z<
        Mapping of TuneD profiles to PPD profiles.
        )�
_tuned_to_ppdr/s r�tuned_to_ppdzPPDConfig.tuned_to_ppdFr6rc��|jS)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/s rr
zPPDConfig.sysfs_acpi_monitorMs���'�'�'rc	��t�}tjj|�st	d|z��	|j|�t|vrt	d|z��t|t�}t|vrt	d|z��t|vrt	d|z��t|vrt	d|z��t|vst|tvrt|_n|tt|_|j|vrt	d|jz��|jtt t"|v��|_|j$rt"|vrt	d	|z��|j$r|t|t"�zn|}t'|j)��t'|j)��zt'|j*j-��z
}|rt	d
dj/|�z��t'|j1��t'|j1��z
}|rt	ddj/|�z��t3t'|j)���t3|�k7s.t3t'|j)���t3|�k7rt	d
|z��t5||�|_t5|j9�D��cic]\}}||��
c}}|j9�D��cic]\}}||��
c}}�|_|jtt<d��|_y#t$rt	d|z��wxYwcc}}wcc}}w)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'TN) r�os�path�isfiler�readr�PROFILES_SECTION�dict�PPD_POWER_SAVER�PPD_BALANCED�PPD_PERFORMANCE�MAIN_SECTION�DEFAULT_PROFILE_OPTIONr1�
getboolean�BATTERY_DETECTION_OPTION�BATTERY_SECTIONr.�set�valuesr)r	�joinr �lenrr4�itemsr8�SYSFS_ACPI_MONITOR_OPTIONr;)	rr+�cfg�profile_dict_ac�profile_dict_dc�unknown_tuned_profiles�unknown_battery_profiles�k�vs	         rr*zPPDConfig.load_from_fileVsB���n���w�w�~�~�k�*� �!I�K�!W�X�X�	\��H�H�[�!��3�&� �!Z�]h�!h�i�i��s�#3�4�5���/�1� �!]�`k�!k�l�l���.� �!Z�]h�!h�i�i��/�1� �!]�`k�!k�l�l��s�"�&<�C��DU�&U�$0�D�!�$'��$5�6L�$M�D�!�� � ��7� �!V�Y]�Yn�Yn�!n�o�o�"%�.�.��?W�bq�ux�bx�.�"y����"�"��c�'A� �!Y�\g�!g�h�h�JN�Ja�Ja�/�D��_�1E�,F�F�gv��#&�o�&<�&<�&>�"?�#�o�F\�F\�F^�B_�"_�cf�gk�g|�g|�hF�hF�hH�dI�"I��!� �!U�X\�Xa�Xa�bx�Xy�!y�z�z�$'��';�';�'=�#>��_�EY�EY�E[�A\�#\� �#� �!P�SW�S\�S\�]u�Sv�!v�w�w��s�?�)�)�+�,�-��_�1E�E��S�Q`�Qg�Qg�Qi�Mj�Ik�or�tC�pD�JD� �![�^i�!i�j�j�'���I���'�/�:O�:O�:Q�(R�:Q�$�!�Q��A��:Q�(R�fu�f{�f{�f}�T~�f}�^b�^_�ab�UV�XY�UY�f}�T~����#&�>�>�,�@Y�dh�>�#i�� ��a�	\� �!L�{�!Z�[�[�	\��\)S��T~s�L8�
M
�<
M�8MN)r!r"r#r$r�propertyrr2r5r9r
r*r%rrr'r')sv���)��'��'��%��%��"��"��"��"��(��(�:jrr')�tuned.utils.config_parserrr�tuned.exceptionsrr>rDrErFrGrBrKrHrJrQrr'r%rr�<module>r\sW��9�+�	�������������"��.��0��"�"�0gj�gjr