added ability to disable modules from the config

This commit is contained in:
iou1name 2018-06-11 12:50:09 -04:00
parent 7a7da7bae7
commit 6cb2a7a4f1

5
bot.py
View File

@ -106,6 +106,9 @@ class Fulvia(irc.IRCClient):
the URL module. the URL module.
""" """
self._disabled_modules = self.config.core.disabled_modules.split(",")
"""These modules will NOT be loaded when load_modules() is called."""
self.load_modules() self.load_modules()
@ -126,6 +129,8 @@ class Fulvia(irc.IRCClient):
failed = 0 failed = 0
for name, path in modules.items(): for name, path in modules.items():
try: try:
if name in self._disabled_modules:
continue
loader.load_module(self, path) loader.load_module(self, path)
loaded += 1 loaded += 1
except Exception as e: except Exception as e: