ó æ ”\c@s}ddlZddlZddlZddlmZddlmZmZddlm Z dgZ de fd„ƒYZ dS(iÿÿÿÿN(t DBusGMainLoop(tGLibtGObjecti(tTunedAdminDBusExceptiontDBusControllercBseZed„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d„Z d „Z d „Z d „Zd „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(cCsp||_||_||_d|_d|_||_d|_d|_d|_ t |_ t |_ d|_dS(N(t _bus_namet_interface_namet _object_nametNonet_proxyt _interfacet_debugt _main_loopt_actiont_on_exit_actiontTruet_rettFalset_exitt _exception(tselftbus_nametinterface_namet object_nametdebug((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pyt__init__ s           cCs¡yw|jdkrvtdtƒtjƒ|_tjƒ}|j |j |j ƒ|_tj |jd|j ƒ|_nWn#tjjk rœtdƒ‚nXdS(Ntset_as_defaulttdbus_interfaces>Cannot talk to Tuned daemon via DBus. Is Tuned daemon running?(R RRRRtMainLoopR tdbust SystemBust get_objectRRt InterfaceRR t exceptionst DBusExceptionR(Rtbus((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pyt _init_proxys  %cCs¬|jdk rYy|j|j|jŽ|_WqYtk rU}||_t|_qYXn|jr›|j dk rŠ|j |j |j Žn|j j ƒtStjdƒtS(Ni(R Rt _action_argst_action_kwargst_action_exit_codeRRRRRt_on_exit_action_argst_on_exit_action_kwargsR tquitRttimetsleep(Rte((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pyt_idle$s      cOs||_||_||_dS(N(RR(R)(Rtactiontargstkwargs((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pytset_on_exit_action7s  cOs||_||_||_dS(N(R R%R&(RR/R0R1((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pyt set_action<s  cCsHd|_tj|jƒ|jjƒ|jdk rA|j‚n|jS(N(RRRtidle_addR.R trunR(R((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pyR5As    cOs‚|jƒy&|jj|ƒ}|dd|ŒSWnKtjjk r}}d}|jrn|dt|ƒ7}nt|ƒ‚nXdS(Nttimeouti(s DBus call to Tuned daemon faileds (%s)( R$R tget_dbus_methodRR!R"R tstrR(Rt method_nameR0R1tmethodtdbus_exceptionterr_str((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pyt_callJs  cCs!|jƒ|jj||ƒdS(N(R$R tconnect_to_signal(Rtsignaltcb((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pytset_signal_handlerVs cCs |jdƒS(Nt is_running(R=(R((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pyRBZscCs |jdƒS(Ntstart(R=(R((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pyRC]scCs |jdƒS(Ntstop(R=(R((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pyRD`scCs |jdƒS(Ntprofiles(R=(R((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pyREcscCs |jdƒS(Nt profiles2(R=(R((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pyRFfscCs|jd|ƒS(Nt profile_info(R=(Rt profile_name((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pyRGiscCs|jd||ƒS(Ntlog_capture_start(R=(Rt log_levelR6((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pyRIlscCs|jd|ƒS(Ntlog_capture_finish(R=(Rttoken((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pyRKoscCs |jdƒS(Ntactive_profile(R=(R((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pyRMrscCs |jdƒS(Nt profile_mode(R=(R((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pyRNuscCs&|dkrtdfS|jd|ƒS(NtsNo profile specifiedtswitch_profile(RR=(Rt new_profile((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pyRPxs  cCs |jdƒS(Nt auto_profile(R=(R((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pyRR}scCs |jdƒS(Ntrecommend_profile(R=(R((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pyRS€scCs |jdƒS(Ntverify_profile(R=(R((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pyRTƒscCs |jdƒS(Ntverify_profile_ignore_missing(R=(R((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pyRU†scCs |jdƒS(Ntdisable(R=(R((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pytoff‰scCs |jdƒS(szReturn dict with plugin names and their hints Return: dictionary -- {plugin_name: {parameter_name: default_value}} tget_all_plugins(R=(R((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pyt get_pluginsŒscCs|jd|ƒS(s"Return docstring of plugin's classtget_plugin_documentation(R=(Rt plugin_name((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pyRZ”scCs|jd|ƒS(sŸReturn dictionary with parameters of plugin and their hints Parameters: plugin_name -- name of plugin Return: dictionary -- {parameter_name: hint} tget_plugin_hints(R=(RR[((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pyR\˜s cCs#|jdƒ||_t|_|S(N(R3RRRR(Rtret((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pytexit£s   (t__name__t __module__RRR$R.R2R3R5R=RARBRCRDRERFRGRIRKRMRNRPRRRSRTRURWRYRZR\R^(((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pyR s8                        ( Rtdbus.exceptionsR+tdbus.mainloop.glibRt gi.repositoryRRR!Rt__all__tobjectR(((s?/usr/lib/python2.7/site-packages/tuned/admin/dbus_controller.pyts