zulip-terminal: Add bot's directory to sys.path.

This commit is contained in:
Sivagiri Visakan 2018-05-20 01:44:22 +05:30 committed by showell
parent 79899dba30
commit 4183f4c0c5

View file

@ -37,6 +37,7 @@ def main():
bot_path = os.path.abspath(os.path.join(current_dir, 'bots', args.bot, args.bot+'.py')) bot_path = os.path.abspath(os.path.join(current_dir, 'bots', args.bot, args.bot+'.py'))
bot_name = args.bot bot_name = args.bot
bot_dir = os.path.dirname(bot_path) bot_dir = os.path.dirname(bot_path)
sys.path.insert(0, bot_dir)
try: try:
lib_module = import_module_from_source(bot_path, bot_name) lib_module = import_module_from_source(bot_path, bot_name)