diff --git a/sandbox/Debug/__init__.py b/sandbox/Debug/__init__.py index cb150cc48..be259a5c7 100644 --- a/sandbox/Debug/__init__.py +++ b/sandbox/Debug/__init__.py @@ -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. diff --git a/sandbox/Debug/plugin.py b/sandbox/Debug/plugin.py index eb5d2dfcf..46541fad2 100644 --- a/sandbox/Debug/plugin.py +++ b/sandbox/Debug/plugin.py @@ -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,