remove external_modules/ and replace with bot.conf and cli arg
This commit is contained in:
parent
514b0126f2
commit
69bf622d2d
3 changed files with 10 additions and 2 deletions
|
@ -18,6 +18,9 @@ bot-channel =
|
||||||
module-blacklist =
|
module-blacklist =
|
||||||
module-whitelist =
|
module-whitelist =
|
||||||
|
|
||||||
|
# path to an external directory for modules to be found in
|
||||||
|
external-modules =
|
||||||
|
|
||||||
# https://openweathermap.org/api
|
# https://openweathermap.org/api
|
||||||
openweathermap-api-key =
|
openweathermap-api-key =
|
||||||
|
|
||||||
|
|
9
start.py
9
start.py
|
@ -42,6 +42,7 @@ arg_parser.add_argument("--module", "-m",
|
||||||
help="Execute an action against a specific module")
|
help="Execute an action against a specific module")
|
||||||
arg_parser.add_argument("--module-args", "-M",
|
arg_parser.add_argument("--module-args", "-M",
|
||||||
help="Arguments to give in action against a specific module")
|
help="Arguments to give in action against a specific module")
|
||||||
|
arg_parser.add_argument("--external", "-e", help="External modules directory")
|
||||||
|
|
||||||
arg_parser.add_argument("--startup-disconnects", "-D",
|
arg_parser.add_argument("--startup-disconnects", "-D",
|
||||||
help="Tolerate failed connections on startup", action="store_true")
|
help="Tolerate failed connections on startup", action="store_true")
|
||||||
|
@ -87,8 +88,12 @@ events = EventManager.EventRoot(log).wrap()
|
||||||
exports = Exports.Exports()
|
exports = Exports.Exports()
|
||||||
timers = Timers.Timers(database, events, log)
|
timers = Timers.Timers(database, events, log)
|
||||||
|
|
||||||
module_directories = [os.path.join(directory, "modules"),
|
module_directories = [os.path.join(directory, "modules")]
|
||||||
os.path.join(directory, "external_modules")]
|
if args.external:
|
||||||
|
module_directories.append(os.path.abspath(args.external))
|
||||||
|
if "external-modules" in config:
|
||||||
|
module_directories.append(os.path.abspath(config["external-modules"]))
|
||||||
|
|
||||||
modules = ModuleManager.ModuleManager(events, exports, timers, config, log,
|
modules = ModuleManager.ModuleManager(events, exports, timers, config, log,
|
||||||
module_directories)
|
module_directories)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue