From f24011559bf6caee2bb4e57a9122fee0ccaed07d Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Mon, 1 Dec 2003 12:39:38 +0000 Subject: [PATCH] Changed the name of cpustats and netstats and cmdstats to remove the stats part. --- plugins/Status.py | 8 ++++---- test/test_Status.py | 10 +++++----- test/test_Utilities.py | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/plugins/Status.py b/plugins/Status.py index 74f2bc629..616723580 100644 --- a/plugins/Status.py +++ b/plugins/Status.py @@ -144,7 +144,7 @@ class Status(callbacks.Privmsg): utils.timeElapsed(ended-started)) irc.reply(msg, utils.commaAndify(imap(format, L))) - def netstats(self, irc, msg, args): + def net(self, irc, msg, args): """takes no arguments Returns some interesting network-related statistics. @@ -155,7 +155,7 @@ class Status(callbacks.Privmsg): (self.recvdMsgs, self.recvdBytes, self.sentMsgs, self.sentBytes)) - def cpustats(self, irc, msg, args): + def cpu(self, irc, msg, args): """takes no arguments Returns some interesting CPU-related statistics on the bot. @@ -192,10 +192,10 @@ class Status(callbacks.Privmsg): mem = os.stat('/proc/%s/mem')[7] response += ' I\'m taking up %s kB of memory.' % mem except Exception: - self.log.exception('Uncaught exception in cpustats:') + self.log.exception('Uncaught exception in cpu:') irc.reply(msg, response) - def cmdstats(self, irc, msg, args): + def cmd(self, irc, msg, args): """takes no arguments Returns some interesting command-related statistics. diff --git a/test/test_Status.py b/test/test_Status.py index 35eed4393..a392d8a55 100644 --- a/test/test_Status.py +++ b/test/test_Status.py @@ -44,25 +44,25 @@ class StatusTestCase(PluginTestCase, PluginDocumentation): self.assertNotError('bestuptime') def testNetstats(self): - self.assertNotError('netstats') + self.assertNotError('net') def testCpustats(self): try: original = world.startedAt world.startedAt = time.time() - self.assertError('cpustats') + self.assertError('cpu') world.startedAt = 0 - self.assertNotError('cpustats') + self.assertNotError('cpu') for s in ['linux', 'freebsd', 'openbsd', 'netbsd']: if sys.platform.startswith(s): - self.assertRegexp('cpustats', 'kB') + self.assertRegexp('cpu', 'kB') finally: world.startedAt = original def testUptime(self): self.assertNotError('uptime') def testCmdstats(self): - self.assertNotError('cmdstats') + self.assertNotError('cmd') def testCommands(self): self.assertNotError('commands') diff --git a/test/test_Utilities.py b/test/test_Utilities.py index 1d539e244..140a4e8c6 100644 --- a/test/test_Utilities.py +++ b/test/test_Utilities.py @@ -63,11 +63,11 @@ class UtilitiesTestCase(PluginTestCase, PluginDocumentation): def testEcho(self): self.assertHelp('echo') self.assertResponse('echo foo', 'foo') - m = self.getMsg('cpustats') + m = self.getMsg('status cpu') self.assertResponse('echo "%s"' % m.args[1], m.args[1]) def testRe(self): - self.assertResponse('re "m/My children/" [cpustats]', 'My children') + self.assertResponse('re "m/My children/" [status cpu]', 'My children') self.assertResponse('re s/user/luser/g user user', 'luser luser') self.assertResponse('re s/user/luser/ user user', 'luser user') self.assertNotRegexp('re m/foo/ bar', 'has no attribute')