From 2ca36362ec5ce9f6083487eb903f2132ac91fcb2 Mon Sep 17 00:00:00 2001 From: Hemna Date: Wed, 21 Dec 2022 10:05:27 -0500 Subject: [PATCH] Fix PluginManager.get_plugins This patch fixes the result of get_plugins to be a list correctly. --- aprsd/plugin.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/aprsd/plugin.py b/aprsd/plugin.py index 0603666..75a8e4c 100644 --- a/aprsd/plugin.py +++ b/aprsd/plugin.py @@ -323,6 +323,8 @@ class PluginManager: # the pluggy PluginManager for all Message plugins _pluggy_pm = None + # the pluggy PluginManager for all WatchList plugins + _watchlist_pm = None # aprsd config dict config = None @@ -476,8 +478,24 @@ class PluginManager: def get_plugins(self): plugin_list = [] if self._pluggy_pm: - plugin_list.append(self._pluggy_pm.get_plugins()) + for plug in self._pluggy_pm.get_plugins(): + plugin_list.append(plug) if self._watchlist_pm: - plugin_list.append(self._watchlist_pm.get_plugins()) + for plug in self._watchlist_pm.get_plugins(): + plugin_list.append(plug) return plugin_list + + def get_watchlist_plugins(self): + pl = [] + if self._watchlist_pm: + for plug in self._watchlist_pm.get_plugins(): + pl.append(plug) + return pl + + def get_message_plugins(self): + pl = [] + if self._pluggy_pm: + for plug in self._pluggy_pm.get_plugins(): + pl.append(plug) + return pl