mirror of
https://github.com/craigerl/aprsd.git
synced 2024-11-18 06:11:49 -05:00
Addressing comments in PR.
This commit is contained in:
parent
c460cefc1a
commit
24714923be
@ -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())
|
||||||
|
@ -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)
|
||||||
|
@ -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,
|
||||||
|
@ -334,15 +334,8 @@ class APRSDPluginProcessPacketThread(APRSDProcessPacketThread):
|
|||||||
# 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:
|
||||||
|
|
||||||
# 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
|
# Tailor the messages accordingly
|
||||||
if help_available:
|
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:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user