35 from .cpp_binding_helper
import qt_gui_cpp
41 super(RosPluginlibPluginProvider, self).
__init__()
46 plugin_descriptors = []
47 for plugin
in discovered_plugins.values():
48 plugin_descriptor =
PluginDescriptor(plugin[
'plugin_id'], plugin[
'attributes'])
50 action_attributes = plugin[
'action']
51 plugin_descriptor.set_action_attributes(
52 action_attributes[
'label'],
53 action_attributes.get(
'statustip',
None),
54 action_attributes.get(
'icon',
None),
55 action_attributes.get(
'icontype',
None))
57 groups = plugin.get(
'groups', {})
58 for group
in groups.values():
59 plugin_descriptor.add_group_attributes(
60 group[
'label'], group[
'statustip'], group[
'icon'], group[
'icontype'])
62 plugin_descriptors.append(plugin_descriptor)
63 return plugin_descriptors
65 def load(self, plugin_id, plugin_context):
66 if qt_gui_cpp
is None:
68 cpp_plugin_context =
None 69 if plugin_context
is not None:
71 plugin_context._handler, plugin_context.serial_number(), plugin_context.argv())
73 loaded = bridge.load_plugin(self.
_plugin_provider, plugin_id, cpp_plugin_context)
76 'RosPluginlibPluginProvider.load() could not load plugin "%s"' % plugin_id)
80 return bridge.unload_plugin()
84 for key, value
in flat_dict.items():
85 keys = str(key).split(
'.')
86 current_level = dictionary
88 if i
not in current_level:
90 current_level = current_level[i]
91 current_level[keys[-1]] = str(value)
if value !=
'' else None
def _unfold(self, flat_dict)
def load(self, plugin_id, plugin_context)
def discover(self, discovery_data)
def __init__(self, plugin_provider)