diff --git a/plugins/Sourceforge.py b/plugins/Sourceforge.py index 285238193..b2694af63 100644 --- a/plugins/Sourceforge.py +++ b/plugins/Sourceforge.py @@ -265,7 +265,23 @@ class Sourceforge(callbacks.PrivmsgCommandAndRegexp): # TODO: consolidate total* into one command which takes options for all # the viable statistics that can be snarfed from the project page - def totalbugs(self, irc, msg, args): + def total(self, irc, msg, args): + """[bugs|rfes] [] + + Returns the total count of open bugs or rfes. is only + necessary if a default project is not set. + """ + if not args: + raise callbacks.ArgumentError + type = args.pop(0) + if type == 'bugs': + self._totalbugs(irc, msg, args) + elif type == 'rfes': + self._totalrfes(irc, msg, args) + else: + raise callbacks.ArgumentError + + def _totalbugs(self, irc, msg, args): """[] Returns a count of the open/total bugs. is not needed if a @@ -281,7 +297,7 @@ class Sourceforge(callbacks.PrivmsgCommandAndRegexp): else: irc.error('Could not find bug statistics.') - def totalrfes(self, irc, msg, args): + def _totalrfes(self, irc, msg, args): """[] Returns a count of the open/total RFEs. is not needed if a diff --git a/test/test_Sourceforge.py b/test/test_Sourceforge.py index 23f253714..63cf65bbf 100644 --- a/test/test_Sourceforge.py +++ b/test/test_Sourceforge.py @@ -170,10 +170,10 @@ if network: original) def testTotal(self): - self.assertRegexp('totalbugs gaim', r'\d+ open / \d+ total') - self.assertRegexp('totalrfes gaim', r'\d+ open / \d+ total') - self.assertError('totalbugs lkjfad') - self.assertError('totalrfes lkjfad') + self.assertRegexp('total bugs gaim', r'\d+ open / \d+ total') + self.assertRegexp('total rfes gaim', r'\d+ open / \d+ total') + self.assertError('total bugs lkjfad') + self.assertError('total rfes lkjfad') def testFight(self): self.assertRegexp('fight gaim opengaim',