diff --git a/aprsd/cmds/listen.py b/aprsd/cmds/listen.py index 12ddcc7..5cecfae 100644 --- a/aprsd/cmds/listen.py +++ b/aprsd/cmds/listen.py @@ -107,9 +107,10 @@ class APRSDListenThread(rx.APRSDRXThread): help="Filter by packet type", ) @click.option( - "--packet-plugins", - default=None, - help="CSV, List of aprsd plugins to enable", + "--load-plugins", + default=False, + is_flag=True, + help="Load plugins as enabled in aprsd.conf ?", ) @click.argument( "filter", @@ -123,7 +124,7 @@ def listen( aprs_login, aprs_password, packet_filter, - packet_plugins, + load_plugins, filter, ): """Listen to packets on the APRS-IS Network based on FILTER. @@ -180,14 +181,16 @@ def listen( keepalive = threads.KeepAliveThread() keepalive.start() - LOG.info(f"Packet plugins {packet_plugins}") - pm = None - if packet_plugins: - LOG.info(f"Load plugins! {packet_plugins}") - pm = plugin.PluginManager() - for plugin_path in packet_plugins.split(","): - pm._load_plugin(plugin_path) + pm = plugin.PluginManager() + if load_plugins: + 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") listen_thread = APRSDListenThread( diff --git a/aprsd/plugin.py b/aprsd/plugin.py index b3d90dc..a2f6dd1 100644 --- a/aprsd/plugin.py +++ b/aprsd/plugin.py @@ -213,7 +213,7 @@ class APRSDRegexCommandPluginBase(APRSDPluginBase, metaclass=abc.ABCMeta): return result 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 result = None