From 05c527a10f52a0e8c251b2caf640aa08fe061b69 Mon Sep 17 00:00:00 2001 From: Abhijeet Kaur Date: Thu, 27 Jul 2017 01:43:42 +0530 Subject: [PATCH] bots: Fix 'run.py' file to run bots. 'bot_name' variable in line number 111 in run.py undefined. --- zulip_bots/zulip_bots/run.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zulip_bots/zulip_bots/run.py b/zulip_bots/zulip_bots/run.py index 93179cc..6d9ae9f 100755 --- a/zulip_bots/zulip_bots/run.py +++ b/zulip_bots/zulip_bots/run.py @@ -87,19 +87,19 @@ the bot handler class. def main(): # type: () -> None options = parse_args() - + bot_name = options.name if options.path_to_bot: if options.provision: bot_dir = os.path.dirname(os.path.abspath(options.path_to_bot)) provision_bot(bot_dir, options.force) - lib_module = import_module_from_source(options.path_to_bot, name=options.name) + lib_module = import_module_from_source(options.path_to_bot, name=bot_name) elif options.name: if options.provision: current_dir = os.path.dirname(os.path.abspath(__file__)) bots_parent_dir = os.path.join(current_dir, "bots") bot_dir = os.path.join(bots_parent_dir, options.name) provision_bot(bot_dir, options.force) - lib_module = import_module('zulip_bots.bots.{bot}.{bot}'.format(bot=options.name)) + lib_module = import_module('zulip_bots.bots.{bot}.{bot}'.format(bot=bot_name)) if not options.quiet: logging.basicConfig(stream=sys.stdout, level=logging.INFO)