1
0
mirror of https://github.com/craigerl/aprsd.git synced 2025-04-16 00:09:12 -04:00

Updated dev to use plugin manager

Also ensure that main creates the client prior to starting the
plugins.
This commit is contained in:
Hemna 2021-10-06 12:09:52 -04:00
parent e3c5c7b408
commit c097c31258
2 changed files with 6 additions and 1 deletions

View File

@ -190,7 +190,9 @@ def test_plugin(
client.Client(config)
pm = plugin.PluginManager(config)
pm._init()
obj = pm._create_class(plugin_path, plugin.APRSDPluginBase, config=config)
pm._pluggy_pm.register(obj)
login = config["aprs"]["login"]
packet = {
@ -200,7 +202,7 @@ def test_plugin(
"msgNo": 1,
}
reply = obj.filter(packet)
reply = pm.run(packet)
# Plugin might have threads, so lets stop them so we can exit.
obj.stop_threads()
LOG.info(f"Result = '{reply}'")

View File

@ -464,6 +464,9 @@ def server(
LOG.error("No Clients are enabled in config.")
sys.exit(-1)
# Creates the client object
client.factory.create().client
# Create the initial PM singleton and Register plugins
plugin_manager = plugin.PluginManager(config)
plugin_manager.setup_plugins()