Simple services classes

This commit is contained in:
Kiooeht 2011-09-28 16:16:01 -07:00
parent ceb180c1c2
commit e1b1f97e9c
2 changed files with 5 additions and 3 deletions

4
irc.py
View file

@ -1,7 +1,7 @@
from PyQt4 import QtGui, QtCore
from oyoyo.client import IRCClient
from oyoyo.cmdhandler import DefaultCommandHandler
from oyoyo import helpers
from oyoyo import helpers, services
import logging
import random
import socket
@ -25,6 +25,8 @@ class PesterIRC(QtCore.QThread):
self.config = config
self.registeredIRC = False
self.stopIRC = None
self.NickServ = services.NickServ()
self.ChanServ = services.ChanServ()
def IRCConnect(self):
server = self.config.server()
port = self.config.port()

View file

@ -110,13 +110,13 @@ def _addServ(serv, funcs, prefix=""):
setattr(serv, t, simplecmd(t.upper()))
class NickServ(object):
def __init__(self, nick):
def __init__(self, nick="NickServ"):
self.name = nick
_addServ(self, _nickservfuncs)
_addServ(self, _nickservsetfuncs, "set")
class ChanServ(object):
def __init__(self, nick):
def __init__(self, nick="ChanServ"):
self.name = nick
_addServ(self, _chanservfuncs)
_addServ(self, _chanservsetfuncs, "set")