+
     GiW  c                   sb    ^ RI t ^ RIt ^ RIt^ RIHt ^ RIHtHt ^RIH	t	 R.t
 ! R R]4      tR# )i    N)DBusGMainLoop)GLibGObject)TunedAdminDBusExceptionDBusControllerc                   s   a  ] tR t^
t o R#R ltR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!R t"R  t#R!t$V t%R"# )$r   c                s    Wn         W n        W0n        R V n        R V n        W@n        R V n        R V n        R V n        RV n	        RV n
        R V n        R # NTF)	_bus_name_interface_name_object_name_proxy
_interface_debug
_main_loop_action_on_exit_action_ret_exit
_exception)selfZbus_nameZinterface_nameZobject_nameZdebugs   &&&&&@/usr/lib/python3.14/site-packages/tuned/admin/dbus_controller.py__init__ZDBusController.__init__   sQ    .'!$+$/+$/$,$$)$*$/    c                s    V P                   f   \        RR7       \        P                  ! 4       V n        \
        P                  ! 4       pVP                  V P                  V P                  4      V n         \
        P                  ! V P                   V P                  R7      V n        R # R #   \
        P                  P                   d    \        R4      hi ; i)NT)Zset_as_default)Zdbus_interfacez>Cannot talk to TuneD daemon via DBus. Is TuneD daemon running?)r	   r    r   ZMainLoopr   dbusZ	SystemBusZ
get_objectr   r   Z	Interfacer   r
   
exceptionsDBusExceptionr   )r   Zbus   & r   _init_proxyZDBusController._init_proxy   s    c
kk&mmoDO
..
C..1B1BCDKnnT[[4CWCWXDO  
	&	& c	 !a	bbcs   B%B+ ++Cc                s   V P                   e-    V P                   ! V P                  / V P                  B V n        V P                  '       dQ   V P                  e'   V P                  ! V P                  / V P                  B  V P                  P                  4        R# \        P                  ! ^4       R#   \         d   pYn        RT n         R p?LR p?ii ; ir   )r   _action_args_action_kwargs_action_exit_coder   r   r   r   _on_exit_action_args_on_exit_action_kwargsr   ZquittimeZsleep)r   Zer   r   _idleZDBusController._idle$   s    	\\!\\4+<+<T@S@STD
 
ZZZ
&$33 %##%??
::a=	 " ODJJs   +B5 5C CCc                *    Wn         W n        W0n        R # N)r   r   r   r   Zactionargskwargs   &&*,r   set_on_exit_actionZ!DBusController.set_on_exit_action7   s    " &r   c                r"   r#   )r   r   r   r$   r'   r   
set_actionZDBusController.set_action<   s    ,r   c                s    R V n         \        P                  ! V P                  4       V P                  P                  4        V P                   e   V P                   hV P                  # r#   )r   r   Zidle_addr!   r   runr   r      &r   r*   ZDBusController.runA   sG    $/--

//	__ 		r   c                s(   V P                  4         V P                  P                  V4      pV! VR ^(/ #   \        P                  P
                   d>   pRpT P                  '       d   TR\        T4      ,          ,          p\        T4      hRp?ii ; i)timeoutz DBus call to TuneD daemon failedz (%s)N)	r   r
   Zget_dbus_methodr   r   r   r   Zstrr   )r   Zmethod_namer%   r&   ZmethodZdbus_exceptionZerr_strs   &&*,   r   _callZDBusController._callJ   s~    *OO++K86
$
#
##		&	& */7
kkkw^,,,G	 	))	*s   "5 B8BBc                s\    V P                  4        V P                  P                  W4       R # r#   )r   r	   Zconnect_to_signal)r   ZsignalZcb   &&&r   set_signal_handlerZ!DBusController.set_signal_handlerV   s     +++r   c                $    V P                  R 4      # )
is_runningr.   r+   r,   r   r2   ZDBusController.is_runningZ   s    	L	!!r   c                r1   )startr3   r+   r,   r   r4   ZDBusController.start]   s    	G	r   c                r1   )stopr3   r+   r,   r   r5   ZDBusController.stop`   s    	F	r   c                r1   )profilesr3   r+   r,   r   r6   ZDBusController.profilesc   s    	J	r   c                r1   )	profiles2r3   r+   r,   r   r7   ZDBusController.profiles2f   s    	K	  r   c                &    V P                  R V4      # )profile_infor3   )r   Zprofile_name   &&r   r9   ZDBusController.profile_infoi   s    	NL	11r   c                &    V P                  R W4      # )log_capture_startr3   )r   Z	log_levelr-   r/   r   r<   Z DBusController.log_capture_startl   s    	'	<<r   c                r8   )log_capture_finishr3   )r   Ztokenr:   r   r=   Z!DBusController.log_capture_finisho   s    	(%	00r   c                r1   )active_profiler3   r+   r,   r   r>   ZDBusController.active_profiler       	$	%%r   c                r1   )profile_moder3   r+   r,   r   r@   ZDBusController.profile_modeu       	N	##r   c                r1   )post_loaded_profiler3   r+   r,   r   rB   Z"DBusController.post_loaded_profilex   s    	)	**r   c                s8    VR 8X  d   R# V P                  RV4      # )Z switch_profile)FzNo profile specifiedr3   )r   Znew_profiler:   r   rC   ZDBusController.switch_profile{   s"    B
))	$k	22r   c                r1   )auto_profiler3   r+   r,   r   rD   ZDBusController.auto_profile   rA   r   c                r1   )recommend_profiler3   r+   r,   r   rE   Z DBusController.recommend_profile   s    	'	((r   c                r1   )verify_profiler3   r+   r,   r   rF   ZDBusController.verify_profile   r?   r   c                r1   )verify_profile_ignore_missingr3   r+   r,   r   rG   Z,DBusController.verify_profile_ignore_missing   s    	3	44r   c                r1   )Zdisabler3   r+   r,   r   offZDBusController.off   s    	I	r   c                s$    V P                  R4      # )ztReturn dict with plugin names and their hints

Return:
dictionary -- {plugin_name: {parameter_name: default_value}}
Zget_all_pluginsr3   r+   r,   r   get_pluginsZDBusController.get_plugins   s     
%	&&r   c                &    V P                  RV4      # )z"Return docstring of plugin's classget_plugin_documentationr3   r   Zplugin_namer:   r   rK   Z'DBusController.get_plugin_documentation   s    	.	<<r   c                rJ   )zReturn dictionary with parameters of plugin and their hints

Parameters:
plugin_name -- name of plugin

Return:
dictionary -- {parameter_name: hint}
get_plugin_hintsr3   rL   r:   r   rM   ZDBusController.get_plugin_hints   s     
&	44r   c                r;   )instance_acquire_devicesr3   )r   Zdevicesinstancer/   r   rN   Z'DBusController.instance_acquire_devices   s    	.	BBr   c                r8   )get_instancesr3   rL   r:   r   rP   ZDBusController.get_instances   s    	O[	11r   c                r8   )instance_get_devicesr3   )r   rO   r:   r   rQ   Z#DBusController.instance_get_devices   s    	*H	55r   c                sB    V P                  R 4       Wn        RV n        V# )NT)r)   r   r   )r   Zretr:   r   exitZDBusController.exit   s    //$)$*	*r   )r   r   r   r   r   r   r   r   r
   r   r   r   r   r   r   r	   r   N)F)&Z__name__Z
__module__Z__qualname__Z__firstlineno__r   r   r!   r(   r)   r*   r.   r0   r2   r4   r5   r6   r7   r9   r<   r=   r>   r@   rB   rC   rD   rE   rF   rG   rH   rI   rK   rM   rN   rP   rQ   rR   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r   r   r   
   s     	c&'


*," !2=1&$+3
$)&5'=	5C26 r   )r   Zdbus.exceptionsr    Zdbus.mainloop.glibr    Zgi.repositoryr   r   r   r   Z__all__Zobjectr   ) r   r   <module>rS      s-       , ' /
iV ir   