mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 11:12:47 +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)
|
||||
here.
|
||||
This is for developers debugging their plugins; it provides an eval command
|
||||
as well as some other useful commands.
|
||||
"""
|
||||
|
||||
import supybot
|
||||
import supybot.world as world
|
||||
|
||||
# XXX Replace this with an appropriate author or supybot.Author instance.
|
||||
__author__ = supybot.authors.unknown
|
||||
__version__ = "%%VERSION%%"
|
||||
|
||||
__author__ = supybot.authors.jemfinch
|
||||
|
||||
# This is a dictionary mapping supybot.Author instances to lists of
|
||||
# contributions.
|
||||
|
@ -42,6 +42,7 @@ import exceptions
|
||||
|
||||
import supybot.conf as conf
|
||||
import supybot.utils as utils
|
||||
import supybot.ircdb as ircdb
|
||||
from supybot.commands import *
|
||||
import supybot.privmsgs as privmsgs
|
||||
import supybot.callbacks as callbacks
|
||||
@ -53,13 +54,20 @@ def getTracer(fd):
|
||||
print >>fd, '%s: %s' % (code.co_filename, code.co_name)
|
||||
return tracer
|
||||
|
||||
class Debug(privmsgs.CapabilityCheckingPrivmsg):
|
||||
class Debug(callbacks.Privmsg):
|
||||
capability = 'owner'
|
||||
def __init__(self):
|
||||
def __init__(self, irc):
|
||||
# Setup exec command.
|
||||
self.__parent = super(Debug, self)
|
||||
self.__parent.__init__(irc)
|
||||
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,
|
||||
'__': None,
|
||||
'___': None,
|
||||
|
Loading…
Reference in New Issue
Block a user