diff --git a/plugins/Enforcer.py b/plugins/Enforcer.py index e5841b0ad..66e45ea42 100644 --- a/plugins/Enforcer.py +++ b/plugins/Enforcer.py @@ -64,6 +64,10 @@ class Enforcer(callbacks.Privmsg, plugins.Toggleable): 'auto-voice': False, 'auto-halfop': False}) started = False + def __init__(self): + callbacks.Privmsg.__init__(self) + plugins.Toggleable.__init__(self) + def start(self, irc, msg, args): """[ ] diff --git a/src/plugins.py b/src/plugins.py index 6728e4442..203913462 100644 --- a/src/plugins.py +++ b/src/plugins.py @@ -32,6 +32,7 @@ import fix import os +import new import sys import sets import time @@ -250,7 +251,12 @@ class Toggleable(object): explicitly sets the value of to . is only necessary if the message isn't sent in the channel itself. Valid names are %s""" % (self._toggleNames()) - self.toggle.__doc__ = s + code = self.toggle.im_func.func_code + globals = self.toggle.im_func.func_globals + closure = self.toggle.im_func.func_closure + newf = new.function(code, globals, None, closure=closure) + newf.__doc__ = s + self.toggle = new.instancemethod(newf, self, self.__class__) def _toggleNames(self): names = self.toggles.defaults.keys()