From 1d0685e02ff735a8869839b41b299d0a000dab8b Mon Sep 17 00:00:00 2001 From: Julian Paul Glass Date: Wed, 10 Dec 2014 01:39:23 +0000 Subject: [PATCH 1/4] Reorder: Move the id to the front of the regexp it represents. --- plugins/MessageParser/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/MessageParser/plugin.py b/plugins/MessageParser/plugin.py index 9b1395af0..67cadec85 100644 --- a/plugins/MessageParser/plugin.py +++ b/plugins/MessageParser/plugin.py @@ -404,7 +404,7 @@ class MessageParser(callbacks.Plugin, plugins.ChannelDBHandler): irc.reply(_('There are no regexp triggers in the database.')) return - s = [ "\"%s\" (%d)" % (regexp[0], regexp[1]) for regexp in regexps ] + s = [ "(%d) \"%s\"" % (regexp[1], regexp[0]) for regexp in regexps ] separator = self.registryValue('listSeparator', channel) irc.reply(separator.join(s)) list = wrap(list, ['channelOrGlobal']) From 92824116c5716ee0df59e3b3f1d3dcdee4a164cf Mon Sep 17 00:00:00 2001 From: Julian Paul Glass Date: Wed, 10 Dec 2014 01:45:31 +0000 Subject: [PATCH 2/4] changes to test.py --- plugins/MessageParser/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/MessageParser/test.py b/plugins/MessageParser/test.py index 71b02194c..edd66ee8d 100644 --- a/plugins/MessageParser/test.py +++ b/plugins/MessageParser/test.py @@ -133,9 +133,9 @@ class MessageParserTestCase(ChannelPluginTestCase): self.assertRegexp('messageparser list', 'There are no regexp triggers in the database\.') self.assertNotError('messageparser add "stuff" "echo i saw some stuff"') - self.assertRegexp('messageparser list', '"stuff" \(1\)') + self.assertRegexp('messageparser list', '\(1\) "stuff"') self.assertNotError('messageparser add "aoeu" "echo vowels are nice!"') - self.assertRegexp('messageparser list', '"stuff" \(1\), "aoeu" \(2\)') + self.assertRegexp('messageparser list', '\(1\) "stuff", \(2\) "aoeu"') def testRemove(self): self.assertError('messageparser remove "stuff"') From 7c0428dfccd0521cf6567314a49981db5e8a5cf7 Mon Sep 17 00:00:00 2001 From: Julian Paul Glass Date: Wed, 10 Dec 2014 02:11:13 +0000 Subject: [PATCH 3/4] Change the id format. Remove the quotes. --- plugins/MessageParser/plugin.py | 2 +- plugins/MessageParser/test.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/MessageParser/plugin.py b/plugins/MessageParser/plugin.py index 67cadec85..6d8a9faf6 100644 --- a/plugins/MessageParser/plugin.py +++ b/plugins/MessageParser/plugin.py @@ -404,7 +404,7 @@ class MessageParser(callbacks.Plugin, plugins.ChannelDBHandler): irc.reply(_('There are no regexp triggers in the database.')) return - s = [ "(%d) \"%s\"" % (regexp[1], regexp[0]) for regexp in regexps ] + s = [ "#%d: %s" % (regexp[1], regexp[0]) for regexp in regexps ] separator = self.registryValue('listSeparator', channel) irc.reply(separator.join(s)) list = wrap(list, ['channelOrGlobal']) diff --git a/plugins/MessageParser/test.py b/plugins/MessageParser/test.py index edd66ee8d..27d88f70a 100644 --- a/plugins/MessageParser/test.py +++ b/plugins/MessageParser/test.py @@ -133,9 +133,9 @@ class MessageParserTestCase(ChannelPluginTestCase): self.assertRegexp('messageparser list', 'There are no regexp triggers in the database\.') self.assertNotError('messageparser add "stuff" "echo i saw some stuff"') - self.assertRegexp('messageparser list', '\(1\) "stuff"') + self.assertRegexp('messageparser list', '#1: stuff') self.assertNotError('messageparser add "aoeu" "echo vowels are nice!"') - self.assertRegexp('messageparser list', '\(1\) "stuff", \(2\) "aoeu"') + self.assertRegexp('messageparser list', '#1: stuff, #2: aoeu') def testRemove(self): self.assertError('messageparser remove "stuff"') From b0169582134940160479d4b6d46f6d26b8f38fd4 Mon Sep 17 00:00:00 2001 From: Julian Paul Glass Date: Wed, 10 Dec 2014 09:23:18 +0000 Subject: [PATCH 4/4] bold formating for the id string. --- plugins/MessageParser/plugin.py | 2 +- plugins/MessageParser/test.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/MessageParser/plugin.py b/plugins/MessageParser/plugin.py index 6d8a9faf6..ef51f234e 100644 --- a/plugins/MessageParser/plugin.py +++ b/plugins/MessageParser/plugin.py @@ -404,7 +404,7 @@ class MessageParser(callbacks.Plugin, plugins.ChannelDBHandler): irc.reply(_('There are no regexp triggers in the database.')) return - s = [ "#%d: %s" % (regexp[1], regexp[0]) for regexp in regexps ] + s = [ "%s: %s" % (ircutils.bold('#'+str(regexp[1])), regexp[0]) for regexp in regexps ] separator = self.registryValue('listSeparator', channel) irc.reply(separator.join(s)) list = wrap(list, ['channelOrGlobal']) diff --git a/plugins/MessageParser/test.py b/plugins/MessageParser/test.py index 27d88f70a..e547d2004 100644 --- a/plugins/MessageParser/test.py +++ b/plugins/MessageParser/test.py @@ -133,9 +133,9 @@ class MessageParserTestCase(ChannelPluginTestCase): self.assertRegexp('messageparser list', 'There are no regexp triggers in the database\.') self.assertNotError('messageparser add "stuff" "echo i saw some stuff"') - self.assertRegexp('messageparser list', '#1: stuff') + self.assertRegexp('messageparser list', '\x02#1\x02: stuff') self.assertNotError('messageparser add "aoeu" "echo vowels are nice!"') - self.assertRegexp('messageparser list', '#1: stuff, #2: aoeu') + self.assertRegexp('messageparser list', '\x02#1\x02: stuff, \x02#2\x02: aoeu') def testRemove(self): self.assertError('messageparser remove "stuff"')