3 d?Z!d@dAZ"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_nameZ object_namedebugr%/usr/lib/python3.6/dbus_controller.py__init__ szDBusController.__init__c CsvyP|jdkrNtddtj|_tj}|j|j|j |_tj |j|j d|_ Wn tj jk rptdYnXdS)NT)Zset_as_default)Zdbus_interfacez>Cannot talk to TuneD daemon via DBus. Is TuneD daemon running?)r rrZMainLooprdbusZ SystemBusZ get_objectrr Z Interfacer r exceptions DBusExceptionr)rZbusrrr _init_proxys   zDBusController._init_proxycCs|jdk rPy|j|j|j|_Wn.tk rN}z||_d|_WYdd}~XnX|jr~|jdk rp|j|j|j |j j dSt j ddS)NTFr)r _action_args_action_kwargsZ_action_exit_coderrrr_on_exit_action_args_on_exit_action_kwargsrquittimeZsleep)rerrr_idle$s    zDBusController._idlecOs||_||_||_dS)N)rrr )ractionargskwargsrrrset_on_exit_action7sz!DBusController.set_on_exit_actioncOs||_||_||_dS)N)rrr)rr%r&r'rrr set_action<szDBusController.set_actioncCs2d|_tj|j|jj|jdk r,|j|jS)N)rrZidle_addr$rrunr)rrrrr*As    zDBusController.runcOsp|jy|jj|}||ddiStjjk rj}z(d}|jrR|dt|7}t|WYdd}~XnXdS)Ntimeout(z DBus call to TuneD daemon failedz (%s)) rr Zget_dbus_methodrrrr strr)rZ method_namer&r'methodZdbus_exceptionZerr_strrrr_callJs zDBusController._callcCs|j|jj||dS)N)rr Zconnect_to_signal)rsignalcbrrrset_signal_handlerVsz!DBusController.set_signal_handlercCs |jdS)N is_running)r/)rrrrr3ZszDBusController.is_runningcCs |jdS)Nstart)r/)rrrrr4]szDBusController.startcCs |jdS)Nstop)r/)rrrrr5`szDBusController.stopcCs |jdS)Nprofiles)r/)rrrrr6cszDBusController.profilescCs |jdS)N profiles2)r/)rrrrr7fszDBusController.profiles2cCs |jd|S)N profile_info)r/)rZ profile_namerrrr8iszDBusController.profile_infocCs|jd||S)Nlog_capture_start)r/)rZ log_levelr+rrrr9lsz DBusController.log_capture_startcCs |jd|S)Nlog_capture_finish)r/)rtokenrrrr:osz!DBusController.log_capture_finishcCs |jdS)Nactive_profile)r/)rrrrr<rszDBusController.active_profilecCs |jdS)N profile_mode)r/)rrrrr=uszDBusController.profile_modecCs |jdS)Npost_loaded_profile)r/)rrrrr>xsz"DBusController.post_loaded_profilecCs|dkr dS|jd|S)NFNo profile specifiedswitch_profile)Fr@)r/)rZ new_profilerrrrA{szDBusController.switch_profilecCs |jdS)N auto_profile)r/)rrrrrBszDBusController.auto_profilecCs |jdS)Nrecommend_profile)r/)rrrrrCsz DBusController.recommend_profilecCs |jdS)Nverify_profile)r/)rrrrrDszDBusController.verify_profilecCs |jdS)Nverify_profile_ignore_missing)r/)rrrrrEsz,DBusController.verify_profile_ignore_missingcCs |jdS)Ndisable)r/)rrrroffszDBusController.offcCs |jdS)zzReturn dict with plugin names and their hints Return: dictionary -- {plugin_name: {parameter_name: default_value}} Zget_all_plugins)r/)rrrr get_pluginsszDBusController.get_pluginscCs |jd|S)z"Return docstring of plugin's classget_plugin_documentation)r/)r plugin_namerrrrIsz'DBusController.get_plugin_documentationcCs |jd|S)zReturn dictionary with parameters of plugin and their hints Parameters: plugin_name -- name of plugin Return: dictionary -- {parameter_name: hint} get_plugin_hints)r/)rrJrrrrKs zDBusController.get_plugin_hintscCs|jd||S)Ninstance_acquire_devices)r/)rZdevicesinstancerrrrLsz'DBusController.instance_acquire_devicescCs |jd|S)N get_instances)r/)rrJrrrrNszDBusController.get_instancescCs |jd|S)Ninstance_get_devices)r/)rrMrrrrOsz#DBusController.instance_get_devicescCs|jd||_d|_|S)NT)r)rr)rretrrrexits zDBusController.exitN)F)#__name__ __module__ __qualname__rrr$r(r)r*r/r2r3r4r5r6r7r8r9r:r<r=r>rArBrCrDrErGrHrIrKrLrNrOrQrrrrr s@     ) rZdbus.exceptionsr"Zdbus.mainloop.glibrZ gi.repositoryrrrr__all__objectrrrrrs