mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-02 17:29:22 +01:00
Enforce the noExtraness of these commands.
This commit is contained in:
parent
1b611d75d9
commit
e803bc1e0a
@ -46,7 +46,7 @@ from itertools import islice, ifilter, imap
|
|||||||
import supybot.conf as conf
|
import supybot.conf as conf
|
||||||
import supybot.utils as utils
|
import supybot.utils as utils
|
||||||
import supybot.world as world
|
import supybot.world as world
|
||||||
import supybot.privmsgs as privmsgs
|
from supybot.commands import wrap
|
||||||
import supybot.registry as registry
|
import supybot.registry as registry
|
||||||
import supybot.callbacks as callbacks
|
import supybot.callbacks as callbacks
|
||||||
|
|
||||||
@ -100,6 +100,7 @@ class Status(callbacks.Privmsg):
|
|||||||
if world.profiling:
|
if world.profiling:
|
||||||
L.append('I am currently in code profiling mode.')
|
L.append('I am currently in code profiling mode.')
|
||||||
irc.reply(' '.join(L))
|
irc.reply(' '.join(L))
|
||||||
|
status = wrap(status, noExtra=True)
|
||||||
|
|
||||||
def threads(self, irc, msg, args):
|
def threads(self, irc, msg, args):
|
||||||
"""takes no arguments
|
"""takes no arguments
|
||||||
@ -113,6 +114,7 @@ class Status(callbacks.Privmsg):
|
|||||||
utils.nItems('thread', len(threads)), utils.be(len(threads)),
|
utils.nItems('thread', len(threads)), utils.be(len(threads)),
|
||||||
utils.commaAndify(threads))
|
utils.commaAndify(threads))
|
||||||
irc.reply(s)
|
irc.reply(s)
|
||||||
|
threads = wrap(threads, noExtra=True)
|
||||||
|
|
||||||
def net(self, irc, msg, args):
|
def net(self, irc, msg, args):
|
||||||
"""takes no arguments
|
"""takes no arguments
|
||||||
@ -129,6 +131,7 @@ class Status(callbacks.Privmsg):
|
|||||||
'I have been connected to %s for %s.' %
|
'I have been connected to %s for %s.' %
|
||||||
(self.recvdMsgs, self.recvdBytes,
|
(self.recvdMsgs, self.recvdBytes,
|
||||||
self.sentMsgs, self.sentBytes, irc.server, timeElapsed))
|
self.sentMsgs, self.sentBytes, irc.server, timeElapsed))
|
||||||
|
net = wrap(net, noExtra=True)
|
||||||
|
|
||||||
def cpu(self, irc, msg, args):
|
def cpu(self, irc, msg, args):
|
||||||
"""takes no arguments
|
"""takes no arguments
|
||||||
@ -175,6 +178,7 @@ class Status(callbacks.Privmsg):
|
|||||||
except Exception:
|
except Exception:
|
||||||
self.log.exception('Uncaught exception in cpu.memory:')
|
self.log.exception('Uncaught exception in cpu.memory:')
|
||||||
irc.reply(utils.normalizeWhitespace(response))
|
irc.reply(utils.normalizeWhitespace(response))
|
||||||
|
cpu = wrap(cpu, noExtra=True)
|
||||||
|
|
||||||
def cmd(self, irc, msg, args):
|
def cmd(self, irc, msg, args):
|
||||||
"""takes no arguments
|
"""takes no arguments
|
||||||
@ -196,6 +200,7 @@ class Status(callbacks.Privmsg):
|
|||||||
utils.nItems('plugin', callbacksPrivmsg, 'command-based'),
|
utils.nItems('plugin', callbacksPrivmsg, 'command-based'),
|
||||||
utils.nItems('command', world.commandsProcessed))
|
utils.nItems('command', world.commandsProcessed))
|
||||||
irc.reply(s)
|
irc.reply(s)
|
||||||
|
cmd = wrap(cmd, noExtra=True)
|
||||||
|
|
||||||
def commands(self, irc, msg, args):
|
def commands(self, irc, msg, args):
|
||||||
"""takes no arguments
|
"""takes no arguments
|
||||||
@ -213,6 +218,7 @@ class Status(callbacks.Privmsg):
|
|||||||
commands = list(commands)
|
commands = list(commands)
|
||||||
commands.sort()
|
commands.sort()
|
||||||
irc.reply(utils.commaAndify(commands))
|
irc.reply(utils.commaAndify(commands))
|
||||||
|
commands = wrap(commands, noExtra=True)
|
||||||
|
|
||||||
def uptime(self, irc, msg, args):
|
def uptime(self, irc, msg, args):
|
||||||
"""takes no arguments
|
"""takes no arguments
|
||||||
@ -222,6 +228,7 @@ class Status(callbacks.Privmsg):
|
|||||||
response = 'I have been running for %s.' % \
|
response = 'I have been running for %s.' % \
|
||||||
utils.timeElapsed(time.time() - world.startedAt)
|
utils.timeElapsed(time.time() - world.startedAt)
|
||||||
irc.reply(response)
|
irc.reply(response)
|
||||||
|
uptime = wrap(uptime, noExtra=True)
|
||||||
|
|
||||||
def server(self, irc, msg, args):
|
def server(self, irc, msg, args):
|
||||||
"""takes no arguments
|
"""takes no arguments
|
||||||
@ -229,6 +236,7 @@ class Status(callbacks.Privmsg):
|
|||||||
Returns the server the bot is on.
|
Returns the server the bot is on.
|
||||||
"""
|
"""
|
||||||
irc.reply(irc.server)
|
irc.reply(irc.server)
|
||||||
|
server = wrap(server, noExtra=True)
|
||||||
|
|
||||||
|
|
||||||
Class = Status
|
Class = Status
|
||||||
|
Loading…
Reference in New Issue
Block a user