mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-29 21:54:22 +01:00
Fixed __init__ and its error with instancemethods not having adjustable __doc__ strings.
This commit is contained in:
parent
535cdde13c
commit
6d36432508
@ -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>]
|
||||
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user