mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-30 14:14:37 +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-voice': False,
|
||||||
'auto-halfop': False})
|
'auto-halfop': False})
|
||||||
started = False
|
started = False
|
||||||
|
def __init__(self):
|
||||||
|
callbacks.Privmsg.__init__(self)
|
||||||
|
plugins.Toggleable.__init__(self)
|
||||||
|
|
||||||
def start(self, irc, msg, args):
|
def start(self, irc, msg, args):
|
||||||
"""[<CHANSERV> <revenge>]
|
"""[<CHANSERV> <revenge>]
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
import fix
|
import fix
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import new
|
||||||
import sys
|
import sys
|
||||||
import sets
|
import sets
|
||||||
import time
|
import time
|
||||||
@ -250,7 +251,12 @@ class Toggleable(object):
|
|||||||
explicitly sets the value of <name> to <value>. <channel> is only
|
explicitly sets the value of <name> to <value>. <channel> is only
|
||||||
necessary if the message isn't sent in the channel itself. Valid
|
necessary if the message isn't sent in the channel itself. Valid
|
||||||
names are %s""" % (self._toggleNames())
|
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):
|
def _toggleNames(self):
|
||||||
names = self.toggles.defaults.keys()
|
names = self.toggles.defaults.keys()
|
||||||
|
Loading…
Reference in New Issue
Block a user