From af2e01a330dad378ed609aa58e9d715125bed83e Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sun, 7 Aug 2011 22:51:05 -0400 Subject: [PATCH] fixing imports in IRC commands --- bot/commands/afc_report.py | 6 +----- bot/commands/afc_status.py | 8 ++++---- bot/commands/calc.py | 2 +- bot/commands/chanops.py | 4 ++-- bot/commands/crypt.py | 4 ++-- bot/commands/git.py | 4 ++-- bot/commands/link.py | 2 +- bot/commands/remind.py | 2 +- bot/commands/rights.py | 6 +++--- bot/commands/tasks.py | 12 ++++++------ 10 files changed, 23 insertions(+), 27 deletions(-) diff --git a/bot/commands/afc_report.py b/bot/commands/afc_report.py index 09ec914..c32220e 100644 --- a/bot/commands/afc_report.py +++ b/bot/commands/afc_report.py @@ -1,14 +1,10 @@ # -*- coding: utf-8 -*- -""" -Get information about an AFC submission by name. -""" - import json import re import urllib -from irc.classes import BaseCommand +from classes import BaseCommand class AFCReport(BaseCommand): def get_hooks(self): diff --git a/bot/commands/afc_status.py b/bot/commands/afc_status.py index 0f5722e..1258eae 100644 --- a/bot/commands/afc_status.py +++ b/bot/commands/afc_status.py @@ -5,9 +5,9 @@ or a request via !status.""" import re -from core import config -from irc.classes import BaseCommand -from wiki import tools +from classes import BaseCommand +import config +import wiki class AFCStatus(BaseCommand): def get_hooks(self): @@ -28,7 +28,7 @@ class AFCStatus(BaseCommand): return False def process(self, data): - self.site = tools.get_site() + self.site = wiki.get_site() if data.line[1] == "JOIN": notice = self.get_join_notice() diff --git a/bot/commands/calc.py b/bot/commands/calc.py index fbd26a1..2a138a0 100644 --- a/bot/commands/calc.py +++ b/bot/commands/calc.py @@ -5,7 +5,7 @@ import re import urllib -from irc.classes import BaseCommand +from classes import BaseCommand class Calc(BaseCommand): def get_hooks(self): diff --git a/bot/commands/chanops.py b/bot/commands/chanops.py index 210a830..fec8399 100644 --- a/bot/commands/chanops.py +++ b/bot/commands/chanops.py @@ -2,8 +2,8 @@ # Voice/devoice/op/deop users in the channel. -from irc.classes import BaseCommand -from core import config +from classes import BaseCommand +import config class ChanOps(BaseCommand): def get_hooks(self): diff --git a/bot/commands/crypt.py b/bot/commands/crypt.py index 15d6e12..8741342 100644 --- a/bot/commands/crypt.py +++ b/bot/commands/crypt.py @@ -6,8 +6,8 @@ Cryptography functions (hashing and cyphers) for EarwigBot IRC. import hashlib -from irc.classes import BaseCommand -from lib import blowfish +from classes import BaseCommand +import blowfish class Cryptography(BaseCommand): def get_hooks(self): diff --git a/bot/commands/git.py b/bot/commands/git.py index 60c0ecc..d6b67c7 100644 --- a/bot/commands/git.py +++ b/bot/commands/git.py @@ -6,8 +6,8 @@ import shlex import subprocess import re -from irc.classes import BaseCommand -from core import config +from classes import BaseCommand +import config class Git(BaseCommand): def get_hooks(self): diff --git a/bot/commands/link.py b/bot/commands/link.py index b45f4cd..6c972af 100644 --- a/bot/commands/link.py +++ b/bot/commands/link.py @@ -4,7 +4,7 @@ import re -from irc.classes import BaseCommand +from classes import BaseCommand class Link(BaseCommand): def get_hooks(self): diff --git a/bot/commands/remind.py b/bot/commands/remind.py index 963f48c..631f2a1 100644 --- a/bot/commands/remind.py +++ b/bot/commands/remind.py @@ -7,7 +7,7 @@ Set a message to be repeated to you in a certain amount of time. import threading import time -from irc.classes import BaseCommand +from classes import BaseCommand class Remind(BaseCommand): def get_hooks(self): diff --git a/bot/commands/rights.py b/bot/commands/rights.py index 4289002..d84cfa7 100644 --- a/bot/commands/rights.py +++ b/bot/commands/rights.py @@ -4,8 +4,8 @@ Retrieve a list of user rights for a given username via the API. """ -from irc.classes import BaseCommand -from wiki import tools +from classes import BaseCommand +import wiki class Rights(BaseCommand): def get_hooks(self): @@ -25,7 +25,7 @@ class Rights(BaseCommand): return username = ' '.join(data.args) - site = tools.get_site() + site = wiki.get_site() user = site.get_user(username) rights = user.groups() if rights: diff --git a/bot/commands/tasks.py b/bot/commands/tasks.py index 9f33061..a465b84 100644 --- a/bot/commands/tasks.py +++ b/bot/commands/tasks.py @@ -5,9 +5,9 @@ import threading import re -from irc.classes import BaseCommand, Data, KwargParseException -from wiki import task_manager -from core import config +from classes import BaseCommand, Data, KwargParseException +import tasks +import config class Tasks(BaseCommand): def get_hooks(self): @@ -77,7 +77,7 @@ class Tasks(BaseCommand): def do_listall(self): """With !tasks listall or !tasks all, list all loaded tasks, and report whether they are currently running or idle.""" - tasks = task_manager.task_list.keys() + tasks = tasks._tasks.keys() threads = threading.enumerate() tasklist = [] @@ -115,11 +115,11 @@ class Tasks(BaseCommand): self.connection.reply(data, "error parsing argument: \x0303{0}\x0301.".format(arg)) return - if task_name not in task_manager.task_list.keys(): # this task does not exist or hasn't been loaded + if task_name not in tasks._tasks.keys(): # this task does not exist or hasn't been loaded self.connection.reply(data, "task could not be found; either wiki/tasks/{0}.py doesn't exist, or it wasn't loaded correctly.".format(task_name)) return - task_manager.start_task(task_name, **data.kwargs) + tasks.start(task_name, **data.kwargs) self.connection.reply(data, "task \x0302{0}\x0301 started.".format(task_name)) def get_main_thread_name(self):