Explorar el Código

fixing imports in IRC commands

tags/v0.1^2
Ben Kurtovic hace 13 años
padre
commit
af2e01a330
Se han modificado 10 ficheros con 23 adiciones y 27 borrados
  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 Ver fichero

@@ -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):


+ 4
- 4
bot/commands/afc_status.py Ver fichero

@@ -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()


+ 1
- 1
bot/commands/calc.py Ver fichero

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

from irc.classes import BaseCommand
from classes import BaseCommand

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


+ 2
- 2
bot/commands/chanops.py Ver fichero

@@ -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):


+ 2
- 2
bot/commands/crypt.py Ver fichero

@@ -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):


+ 2
- 2
bot/commands/git.py Ver fichero

@@ -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):


+ 1
- 1
bot/commands/link.py Ver fichero

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

import re

from irc.classes import BaseCommand
from classes import BaseCommand

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


+ 1
- 1
bot/commands/remind.py Ver fichero

@@ -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):


+ 3
- 3
bot/commands/rights.py Ver fichero

@@ -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:


+ 6
- 6
bot/commands/tasks.py Ver fichero

@@ -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):


Cargando…
Cancelar
Guardar