mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-17 06:00:42 +01:00
Fixed the Debug plugin actually to work.
This commit is contained in:
parent
8897e6458b
commit
8512f52e27
@ -28,15 +28,16 @@
|
|||||||
###
|
###
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Add a description of the plugin (to be presented to the user inside the wizard)
|
This is for developers debugging their plugins; it provides an eval command
|
||||||
here.
|
as well as some other useful commands.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import supybot
|
import supybot
|
||||||
import supybot.world as world
|
import supybot.world as world
|
||||||
|
|
||||||
# XXX Replace this with an appropriate author or supybot.Author instance.
|
__version__ = "%%VERSION%%"
|
||||||
__author__ = supybot.authors.unknown
|
|
||||||
|
__author__ = supybot.authors.jemfinch
|
||||||
|
|
||||||
# This is a dictionary mapping supybot.Author instances to lists of
|
# This is a dictionary mapping supybot.Author instances to lists of
|
||||||
# contributions.
|
# contributions.
|
||||||
|
@ -42,6 +42,7 @@ import exceptions
|
|||||||
|
|
||||||
import supybot.conf as conf
|
import supybot.conf as conf
|
||||||
import supybot.utils as utils
|
import supybot.utils as utils
|
||||||
|
import supybot.ircdb as ircdb
|
||||||
from supybot.commands import *
|
from supybot.commands import *
|
||||||
import supybot.privmsgs as privmsgs
|
import supybot.privmsgs as privmsgs
|
||||||
import supybot.callbacks as callbacks
|
import supybot.callbacks as callbacks
|
||||||
@ -53,13 +54,20 @@ def getTracer(fd):
|
|||||||
print >>fd, '%s: %s' % (code.co_filename, code.co_name)
|
print >>fd, '%s: %s' % (code.co_filename, code.co_name)
|
||||||
return tracer
|
return tracer
|
||||||
|
|
||||||
class Debug(privmsgs.CapabilityCheckingPrivmsg):
|
class Debug(callbacks.Privmsg):
|
||||||
capability = 'owner'
|
capability = 'owner'
|
||||||
def __init__(self):
|
def __init__(self, irc):
|
||||||
# Setup exec command.
|
# Setup exec command.
|
||||||
|
self.__parent = super(Debug, self)
|
||||||
|
self.__parent.__init__(irc)
|
||||||
setattr(self.__class__, 'exec', self.__class__._exec)
|
setattr(self.__class__, 'exec', self.__class__._exec)
|
||||||
privmsgs.CapabilityCheckingPrivmsg.__init__(self)
|
|
||||||
|
|
||||||
|
def callCommand(self, name, irc, msg, *args, **kwargs):
|
||||||
|
if ircdb.checkCapability(msg.prefix, self.capability):
|
||||||
|
self.__parent.callCommand(name, irc, msg, *args, **kwargs)
|
||||||
|
else:
|
||||||
|
irc.errorNoCapability(self.capability)
|
||||||
|
|
||||||
_evalEnv = {'_': None,
|
_evalEnv = {'_': None,
|
||||||
'__': None,
|
'__': None,
|
||||||
'___': None,
|
'___': None,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user