From 0cb678beedafcc07f8b9b23b1cfd1461ca21c333 Mon Sep 17 00:00:00 2001 From: jtc42 Date: Tue, 19 Nov 2019 21:47:11 +0000 Subject: [PATCH] Use plugin name as JSON object keys --- openflexure_microscope/api/v2/blueprints/plugins.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openflexure_microscope/api/v2/blueprints/plugins.py b/openflexure_microscope/api/v2/blueprints/plugins.py index f6bb1db2..490619bf 100644 --- a/openflexure_microscope/api/v2/blueprints/plugins.py +++ b/openflexure_microscope/api/v2/blueprints/plugins.py @@ -19,12 +19,12 @@ def plugins_representation(plugin_loader_object: PluginLoader): Returns: dict: Dictionary representation of all plugins """ - plugins = [] + plugins = {} for plugin in plugin_loader_object.active: logging.debug(f"Representing plugin {plugin._name}") d = { - "name": plugin._name, + "python_name": plugin._name_python_safe, "plugin": str(plugin), "views": {}, "form": plugin.form, @@ -40,7 +40,7 @@ def plugins_representation(plugin_loader_object: PluginLoader): d["views"][view_id] = view_d - plugins.append(d) + plugins[plugin._name] = d return plugins