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:
parent
e3c5c7b408
commit
c097c31258
@ -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}'")
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user