Add a command line option to run.py for bot config files.

Before this change, we were looking for config files in
default locations in source control, which is not a good
place to look for them.  Now `run.py` and friends have a
command line argument where users can specify the config
files.

Note that the change to server.py is only a partial fix
to make it so that bots that don't use third party config
files won't crash.  That program needs an overhaul, anyway.
This commit is contained in:
Steve Howell 2017-11-27 13:45:05 -08:00 committed by showell
parent 57c90ddca0
commit 536ba1843a
5 changed files with 104 additions and 25 deletions

View file

@ -54,7 +54,13 @@ def load_bot_handlers():
try:
bot_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'bots', bot)
bot_handlers[bot] = ExternalBotHandler(client, bot_dir, bot_details={})
# TODO: Figure out how to pass in third party config info.
bot_handlers[bot] = ExternalBotHandler(
client,
bot_dir,
bot_details={},
bot_config_file=None
)
except SystemExit:
return BadRequest("Cannot fetch user profile for bot {}, make sure you have set up the flaskbotrc "
"file correctly.".format(bot))