From e429c9270b7010f6002f97d2c01652154d651bad Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sat, 14 May 2011 01:14:47 -0400 Subject: [PATCH] some careless errors, and giving command name in traceback --- irc/command_handler.py | 2 +- irc/commands/tasks.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/irc/command_handler.py b/irc/command_handler.py index 33566ee..958642d 100644 --- a/irc/command_handler.py +++ b/irc/command_handler.py @@ -61,6 +61,6 @@ def check(hook, data): try: command.process(data) except: - print "Error executing command:" + print "Error executing command {}:".format(data.command) traceback.print_exc() # catch exceptions and print them break diff --git a/irc/commands/tasks.py b/irc/commands/tasks.py index 625b8fb..08bbe20 100644 --- a/irc/commands/tasks.py +++ b/irc/commands/tasks.py @@ -27,7 +27,7 @@ class Tasks(BaseCommand): return if not data.args: - if data.command == "!tasklist": + if data.command == "tasklist": self.do_list() else: self.connection.reply(data, "no arguments provided. Maybe you wanted '!{cmnd} list', '!{cmnd} start', or '!{cmnd} listall'?".format(cmnd=data.command)) @@ -48,17 +48,17 @@ class Tasks(BaseCommand): def do_list(self): threads = threading.enumerate() for thread in threads: - self.connection.reply(data, thread.name) + self.connection.reply(self.data, thread.name) def do_listall(self): tasks = task_manager.task_list.keys() - self.connection.reply(data, ', '.join(tasks)) + self.connection.reply(self.data, ', '.join(tasks)) def do_start(self): kwargs = {} try: - task_manager.start_task(data.args[1], **kwargs) + task_manager.start_task(self.data.args[1], **kwargs) except IndexError: # no task name given - self.connection.reply(data, "what task do you want me to start?") + self.connection.reply(self.data, "what task do you want me to start?") else: - self.connection.reply(data, "task '{}' started.".format(data.args[1])) + self.connection.reply(self.data, "task '{}' started.".format(self.data.args[1]))