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/admin/__pycache__/dbus_controller.cpython-312.pyc
�

�]�iW��`�ddlZddlZddlZddlmZddlmZmZddlm	Z	dgZ
Gd�de�Zy)�N)�
DBusGMainLoop)�GLib�GObject�)�TunedAdminDBusException�DBusControllerc���eZdZd"d�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d �Z"y!)#rc��||_||_||_d|_d|_||_d|_d|_d|_d|_	d|_
d|_y)NTF)�	_bus_name�_interface_name�_object_name�_proxy�
_interface�_debug�
_main_loop�_action�_on_exit_action�_ret�_exit�
_exception)�self�bus_name�interface_name�object_name�debugs     �@/usr/lib/python3.12/site-packages/tuned/admin/dbus_controller.py�__init__zDBusController.__init__sY���$�.�'�$��!�$���$�+��$�/��$�+��$�/��$�,��$���$�)��$�*��$�/�c��	|j��td��tj�|_tj�}|j|j|j�|_tj|j|j��|_yy#t
jj$rtd��wxYw)NT)�set_as_default)�dbus_interfacez>Cannot talk to TuneD daemon via DBus. Is TuneD daemon running?)rrr�MainLoopr�dbus�	SystemBus�
get_objectrr
�	Interfacerr�
exceptions�
DBusExceptionr)r�buss  r�_init_proxyzDBusController._init_proxys���c�
�k�k����&��m�m�o�D�O�
�.�.�
�C��.�.�����1B�1B�C�D�K��n�n�T�[�[�4�CW�CW�X�D�O���
���	&�	&�c�	 �!a�	b�b�c�s�B B$�$)C
c��|j�,	|j|ji|j��|_|jrM|j�&|j|ji|j��|jj�ytjd�y#t$r}||_d|_Yd}~��d}~wwxYw)NTFr)r�_action_args�_action_kwargs�_action_exit_coderrrr�_on_exit_action_args�_on_exit_action_kwargsr�quit�time�sleep)r�es  r�_idlezDBusController._idle$s���	�\�\���)�T�\�\�4�+<�+<�T��@S�@S�T�D��

�Z�Z�
���&��D���$�3�3�%��#�#�%��?�?����
��:�:�a�=�	
��"���D�O��D�J�J���s�+B(�(	C	�1C�C	c�.�||_||_||_y�N)rr/r0�r�action�args�kwargss    r�set_on_exit_actionz!DBusController.set_on_exit_action7s���$��"�$�� &�$�rc�.�||_||_||_yr7)rr,r-r8s    r�
set_actionzDBusController.set_action<s���$�,��$���$�rc���d|_tj|j�|jj�|j�|j�|jSr7)rr�idle_addr5r�runr�rs rrAzDBusController.runAsG���$�/��-�-��
�
���/�/����	�_�_� �	
����	
���rc��|j�	|jj|�}||ddi�S#tjj
$r/}d}|jr|dt|�zz
}t|��d}~wwxYw)N�timeout�(z DBus call to TuneD daemon failedz (%s))	r*r�get_dbus_methodr#r'r(r�strr)r�method_namer:r;�method�dbus_exception�err_strs       r�_callzDBusController._callJs|������*��O�O�+�+�K�8�6�
�$�
#��
#�#��	
���	&�	&�*�
/�7�
�k�k��w��^�,�,�,�G�	 ��	)�)��	*�s�"5�B�*A<�<Bc�\�|j�|jj||�yr7)r*r�connect_to_signal)r�signal�cbs   r�set_signal_handlerz!DBusController.set_signal_handlerVs"�������+�+�����+rc�$�|jd�S)N�
is_running�rLrBs rrSzDBusController.is_runningZs��	
���L�	!�!rc�$�|jd�S)N�startrTrBs rrVzDBusController.start]s��	
���G�	�rc�$�|jd�S)N�stoprTrBs rrXzDBusController.stop`s��	
���F�	�rc�$�|jd�S)N�profilesrTrBs rrZzDBusController.profilescs��	
���J�	�rc�$�|jd�S)N�	profiles2rTrBs rr\zDBusController.profiles2fs��	
���K�	 � rc�&�|jd|�S)N�profile_inforT)r�profile_names  rr^zDBusController.profile_infois��	
���N�L�	1�1rc�(�|jd||�S)N�log_capture_startrT)r�	log_levelrDs   rraz DBusController.log_capture_startls��	
���'��G�	<�<rc�&�|jd|�S)N�log_capture_finishrT)r�tokens  rrdz!DBusController.log_capture_finishos��	
���(�%�	0�0rc�$�|jd�S)N�active_profilerTrBs rrgzDBusController.active_profiler���	
���$�	%�%rc�$�|jd�S)N�profile_moderTrBs rrjzDBusController.profile_modeu���	
���N�	#�#rc�$�|jd�S)N�post_loaded_profilerTrBs rrmz"DBusController.post_loaded_profilexs��	
���)�	*�*rc�2�|dk(ry|jd|�S)N�)FzNo profile specified�switch_profilerT)r�new_profiles  rrpzDBusController.switch_profile{s���B��
)�	
���$�k�	2�2rc�$�|jd�S)N�auto_profilerTrBs rrszDBusController.auto_profile�rkrc�$�|jd�S)N�recommend_profilerTrBs rruz DBusController.recommend_profile�s��	
���'�	(�(rc�$�|jd�S)N�verify_profilerTrBs rrwzDBusController.verify_profile�rhrc�$�|jd�S)N�verify_profile_ignore_missingrTrBs rryz,DBusController.verify_profile_ignore_missing�s��	
���3�	4�4rc�$�|jd�S)N�disablerTrBs r�offzDBusController.off�s��	
���I�	�rc�$�|jd�S)zzReturn dict with plugin names and their hints

		Return:
		dictionary -- {plugin_name: {parameter_name: default_value}}
		�get_all_pluginsrTrBs r�get_pluginszDBusController.get_plugins�s��
���%�	&�&rc�&�|jd|�S)z"Return docstring of plugin's class�get_plugin_documentationrT�r�plugin_names  rr�z'DBusController.get_plugin_documentation�s��	
���.��	<�<rc�&�|jd|�S)z�Return dictionary with parameters of plugin and their hints

		Parameters:
		plugin_name -- name of plugin

		Return:
		dictionary -- {parameter_name: hint}
		�get_plugin_hintsrTr�s  rr�zDBusController.get_plugin_hints�s��
���&��	4�4rc�(�|jd||�S)N�instance_acquire_devicesrT)r�devices�instances   rr�z'DBusController.instance_acquire_devices�s��	
���.���	B�Brc�&�|jd|�S)N�
get_instancesrTr�s  rr�zDBusController.get_instances�s��	
���O�[�	1�1rc�&�|jd|�S)N�instance_get_devicesrT)rr�s  rr�z#DBusController.instance_get_devices�s��	
���*�H�	5�5rc�D�|jd�||_d|_|S)NT)r>rr)r�rets  r�exitzDBusController.exit�s!���/�/�$���$�)��$�*�	�*rN)F)#�__name__�
__module__�__qualname__rr*r5r<r>rArLrQrSrVrXrZr\r^rardrgrjrmrprsrurwryr|rr�r�r�r�r�r��rrrr
s����	c��&'�
�
�
*�,�"��� �!�2�=�1�&�$�+�3�
$�)�&�5��'�=�	5�C�2�6�
r)
r#�dbus.exceptionsr2�dbus.mainloop.glibr�
gi.repositoryrrr'r�__all__�objectrr�rr�<module>r�s-�����,�'�/��
��i
�V�i
r