Created
October 20, 2010 07:03
-
-
Save progval/635932 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ... | |
from supybot.i18n import PluginInternationalization, internationalizeDocstring | |
_ = PluginInternationalization('Status') | |
class Status(callbacks.Plugin): | |
def __init__(self, irc): | |
self.__parent = super(Status, self) | |
self.__parent.__init__(irc) | |
# XXX It'd be nice if these could be kept in the registry. | |
self.sentMsgs = 0 | |
self.recvdMsgs = 0 | |
self.sentBytes = 0 | |
self.recvdBytes = 0 | |
self.connected = {} | |
@internationalizeDocstring | |
def net(self, irc, msg, args): | |
"""takes no arguments | |
Returns some interesting network-related statistics. | |
""" | |
print _ # Works | |
# ... | |
net = wrap(net) | |
@internationalizeDocstring | |
def cpu(self, irc, msg, args): | |
"""takes no arguments | |
Returns some interesting CPU-related statistics on the bot. | |
""" | |
print _ # Fails | |
# ... | |
cpu = wrap(cpu) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment