1
0
mirror of https://github.com/craigerl/aprsd.git synced 2024-11-25 09:28:38 -05:00

Compare commits

...

3 Commits

Author SHA1 Message Date
afourney
665cd756ca
Merge 1334eded62 into 14274c93b5 2024-10-18 23:10:24 -07:00
14274c93b5 3.4.2 2024-10-18 16:08:09 -04:00
Adam Fourney
1334eded62 Added an option to disable the loading of the help plugin. 2024-09-26 11:24:16 -07:00
4 changed files with 41 additions and 3 deletions

View File

@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file. Dates are d
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
#### [v3.4.2](https://github.com/craigerl/aprsd/compare/v3.4.1...v3.4.2)
> 18 October 2024
- Removed remnants of QueryPlugin [`758007e`](https://github.com/craigerl/aprsd/commit/758007ea3ff809944f9ed4685c74e7eaff0f813b)
- Removed dumping of the stats on exit [`5314856`](https://github.com/craigerl/aprsd/commit/5314856101fbf9f306b112121706e7ac9513a0e4)
- Added color logging of thread names at keepalive [`5e9f92d`](https://github.com/craigerl/aprsd/commit/5e9f92dfa68a9a8841c4a10a1e8a68b3c3d9401d)
- Added packet log distance and new arrows [`3e9bf24`](https://github.com/craigerl/aprsd/commit/3e9bf2422acafe33e4bc3a3eb8d812cd81722ae2)
- Log closing client connection. [`9951b12`](https://github.com/craigerl/aprsd/commit/9951b12e2d0097975d7f482dbe818021f772fce1)
- Sort changelog commits by date [`a65262d`](https://github.com/craigerl/aprsd/commit/a65262d2ff68b5744e402d305656b00bb9950c90)
- Add final stages in Dockerfile [`8cdbf18`](https://github.com/craigerl/aprsd/commit/8cdbf18befd709a88100934cce953572b3a5f473)
- Collector cleanup [`765e02f`](https://github.com/craigerl/aprsd/commit/765e02f5b3237796936cb0378abd560ced906283)
- cleaned up some requirements [`c12c42b`](https://github.com/craigerl/aprsd/commit/c12c42b87605b97fa836a8b40713168602c89d50)
- Cleanup test failures [`14c0a69`](https://github.com/craigerl/aprsd/commit/14c0a699cb70be899d8dfdc11aa15d64bc49155c)
#### [v3.4.1](https://github.com/craigerl/aprsd/compare/v3.4.0...v3.4.1) #### [v3.4.1](https://github.com/craigerl/aprsd/compare/v3.4.0...v3.4.1)
> 23 September 2024 > 23 September 2024

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.",
),
] ]
watch_list_opts = [ watch_list_opts = [

View File

@ -472,9 +472,13 @@ class PluginManager:
del self._pluggy_pm del self._pluggy_pm
self.setup_plugins() self.setup_plugins()
def setup_plugins(self, load_help_plugin=True): def setup_plugins(self, load_help_plugin=None):
"""Create the plugin manager and register plugins.""" """Create the plugin manager and register plugins."""
# If load_help_plugin is not specified, load it from the config
if load_help_plugin is None:
load_help_plugin = CONF.load_help_plugin
LOG.info("Loading APRSD Plugins") LOG.info("Loading APRSD Plugins")
# Help plugin is always enabled. # Help plugin is always enabled.
if load_help_plugin: if load_help_plugin:

View File

@ -328,8 +328,22 @@ 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:
LOG.warning("Sending help!")
message_text = "Unknown command! Send 'help' message for help" # Is the help plugin installed?
help_available = False
for p in pm.get_message_plugins():
if isinstance(p, plugin.HelpPlugin):
help_available = True
break
# Tailor the messages accordingly
if help_available:
LOG.warning("Sending 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,