소스 검색

some careless errors, and giving command name in traceback

tags/v0.1
Ben Kurtovic 13 년 전
부모
커밋
e429c9270b
2개의 변경된 파일7개의 추가작업 그리고 7개의 파일을 삭제
  1. +1
    -1
      irc/command_handler.py
  2. +6
    -6
      irc/commands/tasks.py

+ 1
- 1
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

+ 6
- 6
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]))

불러오는 중...
취소
저장