From 92389f69ef3a5a350ea730a8cffab4f0fec9fb66 Mon Sep 17 00:00:00 2001 From: Daniel F Date: Fri, 19 Mar 2010 13:24:45 -0400 Subject: [PATCH] list regexp id in listall (to be used for showing/removing regexp by id) --- plugins/MessageParser/plugin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/MessageParser/plugin.py b/plugins/MessageParser/plugin.py index 835c66d79..9232c823d 100644 --- a/plugins/MessageParser/plugin.py +++ b/plugins/MessageParser/plugin.py @@ -275,11 +275,11 @@ class MessageParser(callbacks.Plugin, plugins.ChannelDBHandler): Lists regexps present in the triggers database. is only necessary if the message isn't sent in the channel - itself. + itself. Regexp ID listed in paretheses. """ db = self.getDb(channel) cursor = db.cursor() - cursor.execute("SELECT regexp FROM triggers") + cursor.execute("SELECT regexp, id FROM triggers") results = cursor.fetchall() if len(results) != 0: regexps = results @@ -287,7 +287,7 @@ class MessageParser(callbacks.Plugin, plugins.ChannelDBHandler): irc.reply('There are no regexp triggers in the database.') return - s = [ regexp[0] for regexp in regexps ] + s = [ "%s (%d)" % (regexp[0], regexp[1]) for regexp in regexps ] irc.reply('"' + '","'.join(s) + '"') listall = wrap(listall, ['channel'])