Use plugin name as JSON object keys
This commit is contained in:
parent
83391f7edf
commit
0cb678beed
1 changed files with 3 additions and 3 deletions
|
|
@ -19,12 +19,12 @@ def plugins_representation(plugin_loader_object: PluginLoader):
|
||||||
Returns:
|
Returns:
|
||||||
dict: Dictionary representation of all plugins
|
dict: Dictionary representation of all plugins
|
||||||
"""
|
"""
|
||||||
plugins = []
|
plugins = {}
|
||||||
|
|
||||||
for plugin in plugin_loader_object.active:
|
for plugin in plugin_loader_object.active:
|
||||||
logging.debug(f"Representing plugin {plugin._name}")
|
logging.debug(f"Representing plugin {plugin._name}")
|
||||||
d = {
|
d = {
|
||||||
"name": plugin._name,
|
"python_name": plugin._name_python_safe,
|
||||||
"plugin": str(plugin),
|
"plugin": str(plugin),
|
||||||
"views": {},
|
"views": {},
|
||||||
"form": plugin.form,
|
"form": plugin.form,
|
||||||
|
|
@ -40,7 +40,7 @@ def plugins_representation(plugin_loader_object: PluginLoader):
|
||||||
|
|
||||||
d["views"][view_id] = view_d
|
d["views"][view_id] = view_d
|
||||||
|
|
||||||
plugins.append(d)
|
plugins[plugin._name] = d
|
||||||
|
|
||||||
return plugins
|
return plugins
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue