JFIF$        dd7 

Viewing File: /usr/lib/python3.9/site-packages/tuned/admin/__pycache__/dbus_controller.cpython-39.opt-1.pyc

a

���hW�@sZddlZddlZddlZddlmZddlmZmZddlm	Z	dgZ
Gdd�de�ZdS)�N)�
DBusGMainLoop)�GLib�GObject�)�TunedAdminDBusException�DBusControllerc@seZdZdCdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Z d>d?�Z!d@dA�Z"dBS)DrFcCsL||_||_||_d|_d|_||_d|_d|_d|_d|_	d|_
d|_dS)NTF)�	_bus_name�_interface_name�_object_name�_proxy�
_interface�_debug�
_main_loop�_action�_on_exit_action�_ret�_exit�
_exception)�selfZbus_nameZinterface_nameZobject_name�debug�r�?/usr/lib/python3.9/site-packages/tuned/admin/dbus_controller.py�__init__szDBusController.__init__cCstzP|jdurNtdd�t��|_t��}|�|j|j	�|_tj
|j|jd�|_Wntj
jyntd��Yn0dS)NT)Zset_as_default)Zdbus_interfacez>Cannot talk to TuneD daemon via DBus. Is TuneD daemon running?)rrrZMainLoopr�dbusZ	SystemBusZ
get_objectrr
Z	Interfacer	r�
exceptions�
DBusExceptionr)rZbusrrr�_init_proxys


zDBusController._init_proxyc
Cs�|jdurVz|j|ji|j��|_Wn0tyT}z||_d|_WYd}~n
d}~00|jr�|jdurz|j|ji|j	��|j
��dSt�
d�dS)NTFr)r�_action_args�_action_kwargsZ_action_exit_coderrrr�_on_exit_action_args�_on_exit_action_kwargsr�quit�time�sleep)r�errr�_idle$s


�

zDBusController._idlecOs||_||_||_dS�N)rrr �r�action�args�kwargsrrr�set_on_exit_action7sz!DBusController.set_on_exit_actioncOs||_||_||_dSr&)rrrr'rrr�
set_action<szDBusController.set_actioncCs2d|_t�|j�|j��|jdur,|j�|jSr&)rrZidle_addr%r�runr�rrrrr-As

zDBusController.runc
Ost|��z|j�|�}||ddi�WStjjyn}z.d}|jrR|dt|�7}t|��WYd}~n
d}~00dS)N�timeout�(z DBus call to TuneD daemon failedz (%s))	rrZget_dbus_methodrrrr
�strr)rZmethod_namer)r*�methodZdbus_exceptionZerr_strrrr�_callJszDBusController._callcCs|��|j�||�dSr&)rrZconnect_to_signal)r�signal�cbrrr�set_signal_handlerVsz!DBusController.set_signal_handlercCs
|�d�S)N�
is_running�r3r.rrrr7ZszDBusController.is_runningcCs
|�d�S)N�startr8r.rrrr9]szDBusController.startcCs
|�d�S)N�stopr8r.rrrr:`szDBusController.stopcCs
|�d�S)N�profilesr8r.rrrr;cszDBusController.profilescCs
|�d�S)N�	profiles2r8r.rrrr<fszDBusController.profiles2cCs|�d|�S)N�profile_infor8)rZprofile_namerrrr=iszDBusController.profile_infocCs|�d||�S)N�log_capture_startr8)rZ	log_levelr/rrrr>lsz DBusController.log_capture_startcCs|�d|�S)N�log_capture_finishr8)r�tokenrrrr?osz!DBusController.log_capture_finishcCs
|�d�S)N�active_profiler8r.rrrrArszDBusController.active_profilecCs
|�d�S)N�profile_moder8r.rrrrBuszDBusController.profile_modecCs
|�d�S)N�post_loaded_profiler8r.rrrrCxsz"DBusController.post_loaded_profilecCs|dkrdS|�d|�S)N�)FzNo profile specified�switch_profiler8)rZnew_profilerrrrE{szDBusController.switch_profilecCs
|�d�S)N�auto_profiler8r.rrrrF�szDBusController.auto_profilecCs
|�d�S)N�recommend_profiler8r.rrrrG�sz DBusController.recommend_profilecCs
|�d�S)N�verify_profiler8r.rrrrH�szDBusController.verify_profilecCs
|�d�S)N�verify_profile_ignore_missingr8r.rrrrI�sz,DBusController.verify_profile_ignore_missingcCs
|�d�S)N�disabler8r.rrr�off�szDBusController.offcCs
|�d�S)zzReturn dict with plugin names and their hints

		Return:
		dictionary -- {plugin_name: {parameter_name: default_value}}
		Zget_all_pluginsr8r.rrr�get_plugins�szDBusController.get_pluginscCs|�d|�S)z"Return docstring of plugin's class�get_plugin_documentationr8�rZplugin_namerrrrM�sz'DBusController.get_plugin_documentationcCs|�d|�S)z�Return dictionary with parameters of plugin and their hints

		Parameters:
		plugin_name -- name of plugin

		Return:
		dictionary -- {parameter_name: hint}
		�get_plugin_hintsr8rNrrrrO�s	zDBusController.get_plugin_hintscCs|�d||�S)N�instance_acquire_devicesr8)rZdevices�instancerrrrP�sz'DBusController.instance_acquire_devicescCs|�d|�S)N�
get_instancesr8rNrrrrR�szDBusController.get_instancescCs|�d|�S)N�instance_get_devicesr8)rrQrrrrS�sz#DBusController.instance_get_devicescCs|�d�||_d|_|S)NT)r,rr)r�retrrr�exit�s
zDBusController.exitN)F)#�__name__�
__module__�__qualname__rrr%r+r,r-r3r6r7r9r:r;r<r=r>r?rArBrCrErFrGrHrIrKrLrMrOrPrRrSrUrrrrr
s@
	)
rZdbus.exceptionsr"Zdbus.mainloop.glibrZ
gi.repositoryrrrr�__all__�objectrrrrr�<module>s
Back to Directory  nL+D550H?Mx ,D"v]qv;6*Zqn)ZP0!1 A "#a$2Qr D8 a Ri[f\mIykIw0cuFcRı?lO7к_f˓[C$殷WF<_W ԣsKcëIzyQy/_LKℂ;C",pFA:/]=H  ~,ls/9ć:[=/#f;)x{ٛEQ )~ =𘙲r*2~ a _V=' kumFD}KYYC)({ *g&f`툪ry`=^cJ.I](*`wq1dđ#̩͑0;H]u搂@:~וKL Nsh}OIR*8:2 !lDJVo(3=M(zȰ+i*NAr6KnSl)!JJӁ* %݉?|D}d5:eP0R;{$X'xF@.ÊB {,WJuQɲRI;9QE琯62fT.DUJ;*cP A\ILNj!J۱+O\͔]ޒS߼Jȧc%ANolՎprULZԛerE2=XDXgVQeӓk yP7U*omQIs,K`)6\G3t?pgjrmۛجwluGtfh9uyP0D;Uڽ"OXlif$)&|ML0Zrm1[HXPlPR0'G=i2N+0e2]]9VTPO׮7h(F*癈'=QVZDF,d߬~TX G[`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