mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-17 06:00:42 +01:00
More __parent fixes.
This commit is contained in:
parent
e2bb35e02a
commit
4f09fad147
@ -140,12 +140,13 @@ class Dunno(callbacks.Privmsg):
|
|||||||
responses."""
|
responses."""
|
||||||
callAfter = ['MoobotFactoids']
|
callAfter = ['MoobotFactoids']
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(Dunno, self).__init__()
|
self.__parent = super(Dunno, self)
|
||||||
|
self.__parent.__init__()
|
||||||
self.db = DunnoDB()
|
self.db = DunnoDB()
|
||||||
|
|
||||||
def die(self):
|
def die(self):
|
||||||
self.db.close()
|
self.db.close()
|
||||||
super(Dunno, self).die()
|
self.__parent.die()
|
||||||
|
|
||||||
def invalidCommand(self, irc, msg, tokens):
|
def invalidCommand(self, irc, msg, tokens):
|
||||||
channel = msg.args[0]
|
channel = msg.args[0]
|
||||||
|
@ -88,7 +88,8 @@ conf.registerChannelValue(conf.supybot.plugins.Herald, 'throttleTimeAfterPart',
|
|||||||
|
|
||||||
class Herald(callbacks.Privmsg):
|
class Herald(callbacks.Privmsg):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(Herald, self).__init__()
|
self.__parent = super(Herald, self)
|
||||||
|
self.__parent.__init__()
|
||||||
self.db = HeraldDB(filename)
|
self.db = HeraldDB(filename)
|
||||||
world.flushers.append(self.db.flush)
|
world.flushers.append(self.db.flush)
|
||||||
self.lastParts = plugins.ChannelUserDictionary()
|
self.lastParts = plugins.ChannelUserDictionary()
|
||||||
@ -98,7 +99,7 @@ class Herald(callbacks.Privmsg):
|
|||||||
if self.db.flush in world.flushers:
|
if self.db.flush in world.flushers:
|
||||||
world.flushers.remove(self.db.flush)
|
world.flushers.remove(self.db.flush)
|
||||||
self.db.close()
|
self.db.close()
|
||||||
super(Herald, self).die()
|
self.__parent.die()
|
||||||
|
|
||||||
def doJoin(self, irc, msg):
|
def doJoin(self, irc, msg):
|
||||||
channel = msg.args[0]
|
channel = msg.args[0]
|
||||||
|
@ -371,7 +371,8 @@ class Dunno(Exception):
|
|||||||
class Infobot(callbacks.PrivmsgCommandAndRegexp):
|
class Infobot(callbacks.PrivmsgCommandAndRegexp):
|
||||||
regexps = ['doForget', 'doChange', 'doFactoid', 'doUnknown']
|
regexps = ['doForget', 'doChange', 'doFactoid', 'doUnknown']
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(Infobot, self).__init__()
|
self.__parent = super(Infobot, self)
|
||||||
|
self.__parent.__init__()
|
||||||
try:
|
try:
|
||||||
self.db = InfobotDB()
|
self.db = InfobotDB()
|
||||||
except Exception:
|
except Exception:
|
||||||
@ -385,7 +386,7 @@ class Infobot(callbacks.PrivmsgCommandAndRegexp):
|
|||||||
self.addressed = False
|
self.addressed = False
|
||||||
|
|
||||||
def die(self):
|
def die(self):
|
||||||
super(Infobot, self).die()
|
self.__parent.die()
|
||||||
self.db.close()
|
self.db.close()
|
||||||
|
|
||||||
def _error(self, s):
|
def _error(self, s):
|
||||||
@ -530,7 +531,7 @@ class Infobot(callbacks.PrivmsgCommandAndRegexp):
|
|||||||
self.log.debug('Bailing since we received an empty msg.')
|
self.log.debug('Bailing since we received an empty msg.')
|
||||||
return
|
return
|
||||||
msg = ircmsgs.IrcMsg(args=(msg.args[0], payload), msg=msg)
|
msg = ircmsgs.IrcMsg(args=(msg.args[0], payload), msg=msg)
|
||||||
super(Infobot, self).doPrivmsg(irc, msg)
|
self.__parent.doPrivmsg(irc, msg)
|
||||||
finally:
|
finally:
|
||||||
self.force = False
|
self.force = False
|
||||||
self.replied = False
|
self.replied = False
|
||||||
@ -542,7 +543,7 @@ class Infobot(callbacks.PrivmsgCommandAndRegexp):
|
|||||||
try:
|
try:
|
||||||
self.irc = irc
|
self.irc = irc
|
||||||
self.msg = msg
|
self.msg = msg
|
||||||
super(Infobot, self).callCommand(name, irc, msg, *L, **kwargs)
|
self.__parent.callCommand(name, irc, msg, *L, **kwargs)
|
||||||
finally:
|
finally:
|
||||||
self.irc = None
|
self.irc = None
|
||||||
self.msg = None
|
self.msg = None
|
||||||
|
@ -227,11 +227,12 @@ KarmaDB = plugins.DB('Karma',
|
|||||||
class Karma(callbacks.Privmsg):
|
class Karma(callbacks.Privmsg):
|
||||||
callBefore = ('Factoids', 'MoobotFactoids', 'Infobot')
|
callBefore = ('Factoids', 'MoobotFactoids', 'Infobot')
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(Karma, self).__init__()
|
self.__parent = super(Karma, self)
|
||||||
|
self.__parent.__init__()
|
||||||
self.db = KarmaDB()
|
self.db = KarmaDB()
|
||||||
|
|
||||||
def die(self):
|
def die(self):
|
||||||
super(Karma, self).die()
|
self.__parent.die()
|
||||||
self.db.close()
|
self.db.close()
|
||||||
|
|
||||||
def _normalizeThing(self, thing):
|
def _normalizeThing(self, thing):
|
||||||
|
@ -176,12 +176,13 @@ NewsDB = plugins.DB('News',
|
|||||||
|
|
||||||
class News(callbacks.Privmsg):
|
class News(callbacks.Privmsg):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(News, self).__init__()
|
self.__parent = super(News, self)
|
||||||
|
self.__parent.__init__()
|
||||||
self.db = NewsDB()
|
self.db = NewsDB()
|
||||||
self.removeOld = False
|
self.removeOld = False
|
||||||
|
|
||||||
def die(self):
|
def die(self):
|
||||||
super(News, self).die()
|
self.__parent.die()
|
||||||
self.db.close()
|
self.db.close()
|
||||||
|
|
||||||
def add(self, irc, msg, args, channel):
|
def add(self, irc, msg, args, channel):
|
||||||
|
@ -161,11 +161,12 @@ NoteDB = plugins.DB('Note', {'flat': DbiNoteDB})
|
|||||||
|
|
||||||
class Note(callbacks.Privmsg):
|
class Note(callbacks.Privmsg):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(Note, self).__init__()
|
self.__parent= super(Note, self)
|
||||||
|
self.__parent.__init__()
|
||||||
self.db = NoteDB()
|
self.db = NoteDB()
|
||||||
|
|
||||||
def die(self):
|
def die(self):
|
||||||
super(Note, self).die()
|
self.__parent.die()
|
||||||
self.db.close()
|
self.db.close()
|
||||||
|
|
||||||
def doPrivmsg(self, irc, msg):
|
def doPrivmsg(self, irc, msg):
|
||||||
|
@ -201,11 +201,12 @@ QuotesDB = plugins.DB('Quotes',
|
|||||||
|
|
||||||
class Quotes(callbacks.Privmsg):
|
class Quotes(callbacks.Privmsg):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(Quotes, self).__init__()
|
self.__parent = super(Quotes, self)
|
||||||
|
self.__parent.__init__()
|
||||||
self.db = QuotesDB()
|
self.db = QuotesDB()
|
||||||
|
|
||||||
def die(self):
|
def die(self):
|
||||||
super(Quotes, self).die()
|
self.__parent.die()
|
||||||
self.db.close()
|
self.db.close()
|
||||||
|
|
||||||
def add(self, irc, msg, args):
|
def add(self, irc, msg, args):
|
||||||
|
@ -86,7 +86,8 @@ class Seen(callbacks.Privmsg):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.db = SeenDB(filename)
|
self.db = SeenDB(filename)
|
||||||
world.flushers.append(self.db.flush)
|
world.flushers.append(self.db.flush)
|
||||||
super(Seen, self).__init__()
|
self.__parent = super(Seen, self)
|
||||||
|
self.__parent.__init__()
|
||||||
|
|
||||||
def die(self):
|
def die(self):
|
||||||
if self.db.flush in world.flushers:
|
if self.db.flush in world.flushers:
|
||||||
@ -94,7 +95,7 @@ class Seen(callbacks.Privmsg):
|
|||||||
else:
|
else:
|
||||||
self.log.debug('Odd, no flush in flushers: %r', world.flushers)
|
self.log.debug('Odd, no flush in flushers: %r', world.flushers)
|
||||||
self.db.close()
|
self.db.close()
|
||||||
super(Seen, self).die()
|
self.__parent.die()
|
||||||
|
|
||||||
def doPrivmsg(self, irc, msg):
|
def doPrivmsg(self, irc, msg):
|
||||||
if ircutils.isChannel(msg.args[0]):
|
if ircutils.isChannel(msg.args[0]):
|
||||||
|
@ -131,14 +131,15 @@ class Sourceforge(callbacks.PrivmsgCommandAndRegexp):
|
|||||||
_projectURL = 'http://sourceforge.net/projects/'
|
_projectURL = 'http://sourceforge.net/projects/'
|
||||||
_trackerURL = 'http://sourceforge.net/support/tracker.php?aid='
|
_trackerURL = 'http://sourceforge.net/support/tracker.php?aid='
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(Sourceforge, self).__init__()
|
self.__parent = super(Sourceforge, self)
|
||||||
|
self.__parent.__init__()
|
||||||
self.__class__.sf = self.__class__.sourceforge
|
self.__class__.sf = self.__class__.sourceforge
|
||||||
|
|
||||||
def isCommand(self, name):
|
def isCommand(self, name):
|
||||||
if name in ('bug', 'rfe', 'patch'):
|
if name in ('bug', 'rfe', 'patch'):
|
||||||
return self.registryValue('enableSpecificTrackerCommands')
|
return self.registryValue('enableSpecificTrackerCommands')
|
||||||
else:
|
else:
|
||||||
return super(Sourceforge, self).isCommand(name)
|
return self.__parent.isCommand(name)
|
||||||
|
|
||||||
def _formatResp(self, text, num=''):
|
def _formatResp(self, text, num=''):
|
||||||
"""
|
"""
|
||||||
|
@ -178,7 +178,8 @@ filename=os.path.join(conf.supybot.directories.data(), 'WordStats.db')
|
|||||||
class WordStats(callbacks.Privmsg):
|
class WordStats(callbacks.Privmsg):
|
||||||
noIgnore = True
|
noIgnore = True
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(WordStats, self).__init__()
|
self.__parent = super(WordStats, self)
|
||||||
|
self.__parent.__init__()
|
||||||
self.db = WordStatsDB(filename)
|
self.db = WordStatsDB(filename)
|
||||||
self.queried = False
|
self.queried = False
|
||||||
world.flushers.append(self.db.flush)
|
world.flushers.append(self.db.flush)
|
||||||
@ -187,11 +188,11 @@ class WordStats(callbacks.Privmsg):
|
|||||||
if self.db.flush in world.flushers:
|
if self.db.flush in world.flushers:
|
||||||
world.flushers.remove(self.db.flush)
|
world.flushers.remove(self.db.flush)
|
||||||
self.db.close()
|
self.db.close()
|
||||||
super(WordStats, self).die()
|
self.__parent.die()
|
||||||
|
|
||||||
def callCommand(self, *args, **kwargs):
|
def callCommand(self, *args, **kwargs):
|
||||||
self.queried = True
|
self.queried = True
|
||||||
return super(WordStats, self).callCommand(*args, **kwargs)
|
return self.__parent.callCommand(*args, **kwargs)
|
||||||
|
|
||||||
def doPrivmsg(self, irc, msg):
|
def doPrivmsg(self, irc, msg):
|
||||||
# This depends on the fact that it's called after the command.
|
# This depends on the fact that it's called after the command.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user