Fixed __init__ and its error with instancemethods not having adjustable __doc__ strings.

This commit is contained in:
Jeremy Fincher 2003-10-29 06:35:02 +00:00
parent 535cdde13c
commit 6d36432508
2 changed files with 11 additions and 1 deletions

View File

@ -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):
"""[<CHANSERV> <revenge>]

View File

@ -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 <name> to <value>. <channel> 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()