1
0
mirror of https://github.com/craigerl/aprsd.git synced 2024-11-21 23:55:17 -05:00
This commit is contained in:
afourney 2024-11-11 20:49:31 -08:00 committed by GitHub
commit 35c3a458e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 17 additions and 5 deletions

View File

@ -101,7 +101,7 @@ def test_plugin(
pm = plugin.PluginManager() pm = plugin.PluginManager()
if load_all: if load_all:
pm.setup_plugins() pm.setup_plugins(load_help_plugin=CONF.load_help_plugin)
obj = pm._create_class(plugin_path, plugin.APRSDPluginBase) obj = pm._create_class(plugin_path, plugin.APRSDPluginBase)
if not obj: if not obj:
click.echo(ctx.get_help()) click.echo(ctx.get_help())

View File

@ -65,7 +65,7 @@ def server(ctx, flush):
# log file output. # log file output.
LOG.info("Loading Plugin Manager and registering plugins") LOG.info("Loading Plugin Manager and registering plugins")
plugin_manager = plugin.PluginManager() plugin_manager = plugin.PluginManager()
plugin_manager.setup_plugins() plugin_manager.setup_plugins(load_help_plugin=CONF.load_help_plugin)
# Dump all the config options now. # Dump all the config options now.
CONF.log_opt_values(LOG, logging.DEBUG) CONF.log_opt_values(LOG, logging.DEBUG)

View File

@ -136,6 +136,11 @@ aprsd_opts = [
default=True, default=True,
help="Set this to False, to disable logging of packets to the log file.", help="Set this to False, to disable logging of packets to the log file.",
), ),
cfg.BoolOpt(
"load_help_plugin",
default=True,
help="Set this to False to disable the help plugin.",
),
cfg.BoolOpt( cfg.BoolOpt(
"enable_sending_ack_packets", "enable_sending_ack_packets",
default=True, default=True,

View File

@ -470,7 +470,7 @@ class PluginManager:
def reload_plugins(self): def reload_plugins(self):
with self.lock: with self.lock:
del self._pluggy_pm del self._pluggy_pm
self.setup_plugins() self.setup_plugins(load_help_plugin=CONF.load_help_plugin)
def setup_plugins( def setup_plugins(
self, load_help_plugin=True, self, load_help_plugin=True,

View File

@ -333,8 +333,15 @@ class APRSDPluginProcessPacketThread(APRSDProcessPacketThread):
# If the message was for us and we didn't have a # If the message was for us and we didn't have a
# response, then we send a usage statement. # response, then we send a usage statement.
if to_call == CONF.callsign and not replied: if to_call == CONF.callsign and not replied:
# Tailor the messages accordingly
if CONF.load_help_plugin:
LOG.warning("Sending help!") LOG.warning("Sending help!")
message_text = "Unknown command! Send 'help' message for help" message_text = "Unknown command! Send 'help' message for help"
else:
LOG.warning("Unknown command!")
message_text = "Unknown command!"
tx.send( tx.send(
packets.MessagePacket( packets.MessagePacket(
from_call=CONF.callsign, from_call=CONF.callsign,