Browse Source

fixing imports in IRC commands

tags/v0.1^2
Ben Kurtovic 13 years ago
parent
commit
af2e01a330
10 changed files with 23 additions and 27 deletions
  1. +1
    -5
      bot/commands/afc_report.py
  2. +4
    -4
      bot/commands/afc_status.py
  3. +1
    -1
      bot/commands/calc.py
  4. +2
    -2
      bot/commands/chanops.py
  5. +2
    -2
      bot/commands/crypt.py
  6. +2
    -2
      bot/commands/git.py
  7. +1
    -1
      bot/commands/link.py
  8. +1
    -1
      bot/commands/remind.py
  9. +3
    -3
      bot/commands/rights.py
  10. +6
    -6
      bot/commands/tasks.py

+ 1
- 5
bot/commands/afc_report.py View File

@@ -1,14 +1,10 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-


"""
Get information about an AFC submission by name.
"""

import json import json
import re import re
import urllib import urllib


from irc.classes import BaseCommand
from classes import BaseCommand


class AFCReport(BaseCommand): class AFCReport(BaseCommand):
def get_hooks(self): def get_hooks(self):


+ 4
- 4
bot/commands/afc_status.py View File

@@ -5,9 +5,9 @@ or a request via !status."""


import re 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): class AFCStatus(BaseCommand):
def get_hooks(self): def get_hooks(self):
@@ -28,7 +28,7 @@ class AFCStatus(BaseCommand):
return False return False


def process(self, data): def process(self, data):
self.site = tools.get_site()
self.site = wiki.get_site()


if data.line[1] == "JOIN": if data.line[1] == "JOIN":
notice = self.get_join_notice() notice = self.get_join_notice()


+ 1
- 1
bot/commands/calc.py View File

@@ -5,7 +5,7 @@
import re import re
import urllib import urllib


from irc.classes import BaseCommand
from classes import BaseCommand


class Calc(BaseCommand): class Calc(BaseCommand):
def get_hooks(self): def get_hooks(self):


+ 2
- 2
bot/commands/chanops.py View File

@@ -2,8 +2,8 @@


# Voice/devoice/op/deop users in the channel. # 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): class ChanOps(BaseCommand):
def get_hooks(self): def get_hooks(self):


+ 2
- 2
bot/commands/crypt.py View File

@@ -6,8 +6,8 @@ Cryptography functions (hashing and cyphers) for EarwigBot IRC.


import hashlib import hashlib


from irc.classes import BaseCommand
from lib import blowfish
from classes import BaseCommand
import blowfish


class Cryptography(BaseCommand): class Cryptography(BaseCommand):
def get_hooks(self): def get_hooks(self):


+ 2
- 2
bot/commands/git.py View File

@@ -6,8 +6,8 @@ import shlex
import subprocess import subprocess
import re import re


from irc.classes import BaseCommand
from core import config
from classes import BaseCommand
import config


class Git(BaseCommand): class Git(BaseCommand):
def get_hooks(self): def get_hooks(self):


+ 1
- 1
bot/commands/link.py View File

@@ -4,7 +4,7 @@


import re import re


from irc.classes import BaseCommand
from classes import BaseCommand


class Link(BaseCommand): class Link(BaseCommand):
def get_hooks(self): def get_hooks(self):


+ 1
- 1
bot/commands/remind.py View File

@@ -7,7 +7,7 @@ Set a message to be repeated to you in a certain amount of time.
import threading import threading
import time import time


from irc.classes import BaseCommand
from classes import BaseCommand


class Remind(BaseCommand): class Remind(BaseCommand):
def get_hooks(self): def get_hooks(self):


+ 3
- 3
bot/commands/rights.py View File

@@ -4,8 +4,8 @@
Retrieve a list of user rights for a given username via the API. 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): class Rights(BaseCommand):
def get_hooks(self): def get_hooks(self):
@@ -25,7 +25,7 @@ class Rights(BaseCommand):
return return


username = ' '.join(data.args) username = ' '.join(data.args)
site = tools.get_site()
site = wiki.get_site()
user = site.get_user(username) user = site.get_user(username)
rights = user.groups() rights = user.groups()
if rights: if rights:


+ 6
- 6
bot/commands/tasks.py View File

@@ -5,9 +5,9 @@
import threading import threading
import re 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): class Tasks(BaseCommand):
def get_hooks(self): def get_hooks(self):
@@ -77,7 +77,7 @@ class Tasks(BaseCommand):
def do_listall(self): def do_listall(self):
"""With !tasks listall or !tasks all, list all loaded tasks, and report """With !tasks listall or !tasks all, list all loaded tasks, and report
whether they are currently running or idle.""" whether they are currently running or idle."""
tasks = task_manager.task_list.keys()
tasks = tasks._tasks.keys()
threads = threading.enumerate() threads = threading.enumerate()
tasklist = [] tasklist = []


@@ -115,11 +115,11 @@ class Tasks(BaseCommand):
self.connection.reply(data, "error parsing argument: \x0303{0}\x0301.".format(arg)) self.connection.reply(data, "error parsing argument: \x0303{0}\x0301.".format(arg))
return 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)) 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 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)) self.connection.reply(data, "task \x0302{0}\x0301 started.".format(task_name))


def get_main_thread_name(self): def get_main_thread_name(self):


Loading…
Cancel
Save