32 from dbus.service
import BusName, Object
34 from python_qt_binding.QtCore
import qDebug, qWarning
38 """DBus service of the `PluginManager` available on the unique bus name.""" 40 def __init__(self, plugin_manager, application_context):
41 bus_name = BusName(application_context.dbus_unique_bus_name, dbus.SessionBus())
42 super(PluginManagerDBusInterface, self).
__init__(bus_name,
'/PluginManager')
45 @dbus.service.method(
'org.ros.qt_gui.PluginManager', in_signature=
'ss', out_signature=
'is')
47 qDebug(
'PluginManagerDBusInterface.start_plugin(%s)' % plugin_name)
50 msg =
'PluginManagerDBusInterface.start_plugin() found no plugin matching "%s"' % \
54 elif len(plugins) > 1:
55 msg =
'PluginManagerDBusInterface.start_plugin() found multiple plugins ' \
56 'matching "%s"\n%s' % (plugin_name,
'\n'.join(plugins.values()))
59 plugin_id = next(iter(plugins))
60 self.
_plugin_manager.load_plugin(plugin_id, argv=argv.split(
' ')
if argv
else [])
def start_plugin(self, plugin_name, argv)
def __init__(self, plugin_manager, application_context)