mirror of
https://github.com/progval/Limnoria.git
synced 2025-05-01 07:51:06 -05:00
Merge pull request #940 from joulez/messageparser
Reorder: Move the id to the front of the regexp it represents.
This commit is contained in:
commit
b9a3c01bb1
@ -404,7 +404,7 @@ class MessageParser(callbacks.Plugin, plugins.ChannelDBHandler):
|
|||||||
irc.reply(_('There are no regexp triggers in the database.'))
|
irc.reply(_('There are no regexp triggers in the database.'))
|
||||||
return
|
return
|
||||||
|
|
||||||
s = [ "\"%s\" (%d)" % (regexp[0], regexp[1]) for regexp in regexps ]
|
s = [ "%s: %s" % (ircutils.bold('#'+str(regexp[1])), regexp[0]) for regexp in regexps ]
|
||||||
separator = self.registryValue('listSeparator', channel)
|
separator = self.registryValue('listSeparator', channel)
|
||||||
irc.reply(separator.join(s))
|
irc.reply(separator.join(s))
|
||||||
list = wrap(list, ['channelOrGlobal'])
|
list = wrap(list, ['channelOrGlobal'])
|
||||||
|
@ -133,9 +133,9 @@ class MessageParserTestCase(ChannelPluginTestCase):
|
|||||||
self.assertRegexp('messageparser list',
|
self.assertRegexp('messageparser list',
|
||||||
'There are no regexp triggers in the database\.')
|
'There are no regexp triggers in the database\.')
|
||||||
self.assertNotError('messageparser add "stuff" "echo i saw some stuff"')
|
self.assertNotError('messageparser add "stuff" "echo i saw some stuff"')
|
||||||
self.assertRegexp('messageparser list', '"stuff" \(1\)')
|
self.assertRegexp('messageparser list', '\x02#1\x02: stuff')
|
||||||
self.assertNotError('messageparser add "aoeu" "echo vowels are nice!"')
|
self.assertNotError('messageparser add "aoeu" "echo vowels are nice!"')
|
||||||
self.assertRegexp('messageparser list', '"stuff" \(1\), "aoeu" \(2\)')
|
self.assertRegexp('messageparser list', '\x02#1\x02: stuff, \x02#2\x02: aoeu')
|
||||||
|
|
||||||
def testRemove(self):
|
def testRemove(self):
|
||||||
self.assertError('messageparser remove "stuff"')
|
self.assertError('messageparser remove "stuff"')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user