Sfoglia il codice sorgente

converting four IRC command classes to use new config system; everything's been converted except for irc/watcher.py and everything in wiki/

tags/v0.1^2
Ben Kurtovic 13 anni fa
parent
commit
e21a4dfb76
4 ha cambiato i file con 11 aggiunte e 12 eliminazioni
  1. +1
    -2
      irc/commands/afc_status.py
  2. +2
    -2
      irc/commands/chanops.py
  3. +2
    -2
      irc/commands/git.py
  4. +6
    -6
      irc/commands/tasks.py

+ 1
- 2
irc/commands/afc_status.py Vedi File

@@ -6,7 +6,6 @@ import json
import re
import urllib

from config.watcher import *
from irc.base_command import BaseCommand

class AFCStatus(BaseCommand):
@@ -22,7 +21,7 @@ class AFCStatus(BaseCommand):
data.command == "number" or data.command == "afc_status"):
return True
try:
if data.line[1] == "JOIN" and data.chan in AFC_CHANS:
if data.line[1] == "JOIN" and data.chan == "#wikipedia-en-afc":
return True
except IndexError:
pass


+ 2
- 2
irc/commands/chanops.py Vedi File

@@ -3,7 +3,7 @@
# Voice/devoice/op/deop users in the channel.

from irc.base_command import BaseCommand
from config.irc import *
from core import config

class ChanOps(BaseCommand):
def get_hooks(self):
@@ -19,7 +19,7 @@ class ChanOps(BaseCommand):
return False

def process(self, data):
if data.host not in ADMINS:
if data.host not in config.irc.permissions["admins"]:
self.connection.reply(data, "you must be a bot admin to use this command.")
return



+ 2
- 2
irc/commands/git.py Vedi File

@@ -4,8 +4,8 @@

import shlex, subprocess, re

from config.irc import *
from irc.base_command import BaseCommand
from core import config

class Git(BaseCommand):
def get_hooks(self):
@@ -21,7 +21,7 @@ class Git(BaseCommand):

def process(self, data):
self.data = data
if data.host not in OWNERS:
if data.host not in config.irc.permissions["owners"]:
self.connection.reply(data, "you must be a bot owner to use this command.")
return



+ 6
- 6
irc/commands/tasks.py Vedi File

@@ -2,13 +2,13 @@

# Manage wiki tasks from IRC, and check on thread status.

import threading, re
import threading
import re

from irc.base_command import BaseCommand
from irc.data import *
from wiki import task_manager
from config.main import *
from config.irc import *
from core import config

class Tasks(BaseCommand):
def get_hooks(self):
@@ -24,7 +24,7 @@ class Tasks(BaseCommand):

def process(self, data):
self.data = data
if data.host not in OWNERS:
if data.host not in config.irc.permissions["owners"]:
self.connection.reply(data, "at this time, you must be a bot owner to use this command.")
return

@@ -116,9 +116,9 @@ class Tasks(BaseCommand):

def get_main_thread_name(self):
"""Return the "proper" name of the MainThread; e.g. "irc-frontend" or "irc-watcher"."""
if enable_irc_frontend:
if config.components["irc_frontend"]:
return "irc-frontend"
elif enable_wiki_schedule:
elif config.components["wiki_schedule"]:
return "wiki-scheduler"
else:
return "irc-watcher"

Caricamento…
Annulla
Salva