diff --git a/plugins/Topic.py b/plugins/Topic.py index 527001170..23605ee40 100644 --- a/plugins/Topic.py +++ b/plugins/Topic.py @@ -67,7 +67,7 @@ class Topic(callbacks.Privmsg): topicSeparator = ' || ' topicFormatter = '%s (%s)' topicUnformatter = re.compile('(.*) \((\S+)\)') - def addtopic(self, irc, msg, args, channel): + def add(self, irc, msg, args, channel): """[] Adds to the topics for . is only necessary @@ -90,9 +90,9 @@ class Topic(callbacks.Privmsg): else: newTopic = formattedTopic irc.queueMsg(ircmsgs.topic(channel, newTopic)) - addtopic = privmsgs.checkChannelCapability(addtopic, 'topic') + add = privmsgs.checkChannelCapability(add, 'topic') - def shuffletopic(self, irc, msg, args, channel): + def shuffle(self, irc, msg, args, channel): """[] Shuffles the topics in . is only necessary if the @@ -106,9 +106,9 @@ class Topic(callbacks.Privmsg): random.shuffle(topics) newtopic = self.topicSeparator.join(topics) irc.queueMsg(ircmsgs.topic(channel, newtopic)) - shuffletopic = privmsgs.checkChannelCapability(shuffletopic, 'topic') + shuffle = privmsgs.checkChannelCapability(shuffle, 'topic') - def gettopic(self, irc, msg, args, channel): + def get(self, irc, msg, args, channel): """[] Returns topic number from . is a one-based @@ -129,9 +129,9 @@ class Topic(callbacks.Privmsg): except IndexError: irc.error(msg, 'That\'s not a valid topic.') return - gettopic = privmsgs.channel(gettopic) + get = privmsgs.channel(get) - def changetopic(self, irc, msg, args, channel): + def change(self, irc, msg, args, channel): """[] Changes the topic number on according to the regular @@ -178,9 +178,9 @@ class Topic(callbacks.Privmsg): topics.insert(number, newTopic) newTopic = self.topicSeparator.join(topics) irc.queueMsg(ircmsgs.topic(channel, newTopic)) - changetopic = privmsgs.checkChannelCapability(changetopic, 'topic') + change = privmsgs.checkChannelCapability(change, 'topic') - def removetopic(self, irc, msg, args, channel): + def remove(self, irc, msg, args, channel): """[] Removes topic from the topic for Topics are @@ -217,7 +217,7 @@ class Topic(callbacks.Privmsg): return newTopic = self.topicSeparator.join(topics) irc.queueMsg(ircmsgs.topic(channel, newTopic)) - removetopic = privmsgs.checkChannelCapability(removetopic, 'topic') + remove = privmsgs.checkChannelCapability(remove, 'topic') Class = Topic diff --git a/test/test_Topic.py b/test/test_Topic.py index fadb4331c..8b030bb33 100644 --- a/test/test_Topic.py +++ b/test/test_Topic.py @@ -36,27 +36,27 @@ class TopicTestCase(PluginTestCase, PluginDocumentation): def testAddtopic(self): _ = self.getMsg('join #foo') _ = self.getMsg(' ') # Get the WHO. - m = self.getMsg('addtopic #foo foo') + m = self.getMsg('topic add #foo foo') self.assertEqual(m.command, 'TOPIC') self.assertEqual(m.args[0], '#foo') self.assertEqual(m.args[1], 'foo (test)') - m = self.getMsg('addtopic #foo bar') + m = self.getMsg('topic add #foo bar') self.assertEqual(m.command, 'TOPIC') self.assertEqual(m.args[0], '#foo') def testChangetopic(self): _ = self.getMsg('join #foo') _ = self.getMsg(' ') - _ = self.getMsg('addtopic #foo foo') - _ = self.getMsg('addtopic #foo bar') - _ = self.getMsg('addtopic #foo baz') - self.assertRegexp('changetopic #foo -1 s/baz/biff/', + _ = self.getMsg('topic add #foo foo') + _ = self.getMsg('topic add #foo bar') + _ = self.getMsg('topic add #foo baz') + self.assertRegexp('topic change #foo -1 s/baz/biff/', r'foo.*bar.*biff') - self.assertRegexp('changetopic #foo 2 s/bar/baz/', + self.assertRegexp('topic change #foo 2 s/bar/baz/', r'foo.*baz.*biff') - self.assertRegexp('changetopic #foo 1 s/foo/bar/', + self.assertRegexp('topic change #foo 1 s/foo/bar/', r'bar.*baz.*biff') - self.assertRegexp('changetopic #foo -2 s/baz/bazz/', + self.assertRegexp('topic change #foo -2 s/baz/bazz/', r'bar.*bazz.*biff')