mirror of
https://github.com/craigerl/aprsd.git
synced 2025-06-27 22:45:24 -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)
|
client.Client(config)
|
||||||
|
|
||||||
pm = plugin.PluginManager(config)
|
pm = plugin.PluginManager(config)
|
||||||
|
pm._init()
|
||||||
obj = pm._create_class(plugin_path, plugin.APRSDPluginBase, config=config)
|
obj = pm._create_class(plugin_path, plugin.APRSDPluginBase, config=config)
|
||||||
|
pm._pluggy_pm.register(obj)
|
||||||
login = config["aprs"]["login"]
|
login = config["aprs"]["login"]
|
||||||
|
|
||||||
packet = {
|
packet = {
|
||||||
@ -200,7 +202,7 @@ def test_plugin(
|
|||||||
"msgNo": 1,
|
"msgNo": 1,
|
||||||
}
|
}
|
||||||
|
|
||||||
reply = obj.filter(packet)
|
reply = pm.run(packet)
|
||||||
# Plugin might have threads, so lets stop them so we can exit.
|
# Plugin might have threads, so lets stop them so we can exit.
|
||||||
obj.stop_threads()
|
obj.stop_threads()
|
||||||
LOG.info(f"Result = '{reply}'")
|
LOG.info(f"Result = '{reply}'")
|
||||||
|
@ -464,6 +464,9 @@ def server(
|
|||||||
LOG.error("No Clients are enabled in config.")
|
LOG.error("No Clients are enabled in config.")
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
|
||||||
|
# Creates the client object
|
||||||
|
client.factory.create().client
|
||||||
|
|
||||||
# Create the initial PM singleton and Register plugins
|
# Create the initial PM singleton and Register plugins
|
||||||
plugin_manager = plugin.PluginManager(config)
|
plugin_manager = plugin.PluginManager(config)
|
||||||
plugin_manager.setup_plugins()
|
plugin_manager.setup_plugins()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user