mirror of
https://github.com/craigerl/aprsd.git
synced 2024-11-17 22:01:49 -05:00
Change listen command plugins
The listen command now adds the --load-plugins, which is false by default, to load all the plugins as defined in the config file.
This commit is contained in:
parent
c353877321
commit
0ec41f7605
@ -107,9 +107,10 @@ class APRSDListenThread(rx.APRSDRXThread):
|
|||||||
help="Filter by packet type",
|
help="Filter by packet type",
|
||||||
)
|
)
|
||||||
@click.option(
|
@click.option(
|
||||||
"--packet-plugins",
|
"--load-plugins",
|
||||||
default=None,
|
default=False,
|
||||||
help="CSV, List of aprsd plugins to enable",
|
is_flag=True,
|
||||||
|
help="Load plugins as enabled in aprsd.conf ?",
|
||||||
)
|
)
|
||||||
@click.argument(
|
@click.argument(
|
||||||
"filter",
|
"filter",
|
||||||
@ -123,7 +124,7 @@ def listen(
|
|||||||
aprs_login,
|
aprs_login,
|
||||||
aprs_password,
|
aprs_password,
|
||||||
packet_filter,
|
packet_filter,
|
||||||
packet_plugins,
|
load_plugins,
|
||||||
filter,
|
filter,
|
||||||
):
|
):
|
||||||
"""Listen to packets on the APRS-IS Network based on FILTER.
|
"""Listen to packets on the APRS-IS Network based on FILTER.
|
||||||
@ -180,14 +181,16 @@ def listen(
|
|||||||
keepalive = threads.KeepAliveThread()
|
keepalive = threads.KeepAliveThread()
|
||||||
keepalive.start()
|
keepalive.start()
|
||||||
|
|
||||||
LOG.info(f"Packet plugins {packet_plugins}")
|
|
||||||
|
|
||||||
pm = None
|
pm = None
|
||||||
if packet_plugins:
|
|
||||||
LOG.info(f"Load plugins! {packet_plugins}")
|
|
||||||
pm = plugin.PluginManager()
|
pm = plugin.PluginManager()
|
||||||
for plugin_path in packet_plugins.split(","):
|
if load_plugins:
|
||||||
pm._load_plugin(plugin_path)
|
LOG.info("Loading plugins")
|
||||||
|
pm.setup_plugins()
|
||||||
|
else:
|
||||||
|
LOG.warning(
|
||||||
|
"Not Loading any plugins use --load-plugins to load what's "
|
||||||
|
"defined in the config file.",
|
||||||
|
)
|
||||||
|
|
||||||
LOG.debug("Create APRSDListenThread")
|
LOG.debug("Create APRSDListenThread")
|
||||||
listen_thread = APRSDListenThread(
|
listen_thread = APRSDListenThread(
|
||||||
|
@ -213,7 +213,7 @@ class APRSDRegexCommandPluginBase(APRSDPluginBase, metaclass=abc.ABCMeta):
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
if not isinstance(packet, packets.core.MessagePacket):
|
if not isinstance(packet, packets.core.MessagePacket):
|
||||||
LOG.warning(f"Got a {packet.__class__.__name__} ignoring")
|
LOG.warning(f"{self.__class__.__name__} Got a {packet.__class__.__name__} ignoring")
|
||||||
return packets.NULL_MESSAGE
|
return packets.NULL_MESSAGE
|
||||||
|
|
||||||
result = None
|
result = None
|
||||||
|
Loading…
Reference in New Issue
Block a user