mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-25 04:02:46 +01:00
list regexp id in listall (to be used for showing/removing regexp by id)
This commit is contained in:
parent
e2d16cb3a7
commit
92389f69ef
@ -275,11 +275,11 @@ class MessageParser(callbacks.Plugin, plugins.ChannelDBHandler):
|
|||||||
|
|
||||||
Lists regexps present in the triggers database.
|
Lists regexps present in the triggers database.
|
||||||
<channel> is only necessary if the message isn't sent in the channel
|
<channel> is only necessary if the message isn't sent in the channel
|
||||||
itself.
|
itself. Regexp ID listed in paretheses.
|
||||||
"""
|
"""
|
||||||
db = self.getDb(channel)
|
db = self.getDb(channel)
|
||||||
cursor = db.cursor()
|
cursor = db.cursor()
|
||||||
cursor.execute("SELECT regexp FROM triggers")
|
cursor.execute("SELECT regexp, id FROM triggers")
|
||||||
results = cursor.fetchall()
|
results = cursor.fetchall()
|
||||||
if len(results) != 0:
|
if len(results) != 0:
|
||||||
regexps = results
|
regexps = results
|
||||||
@ -287,7 +287,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 = [ regexp[0] for regexp in regexps ]
|
s = [ "%s (%d)" % (regexp[0], regexp[1]) for regexp in regexps ]
|
||||||
irc.reply('"' + '","'.join(s) + '"')
|
irc.reply('"' + '","'.join(s) + '"')
|
||||||
listall = wrap(listall, ['channel'])
|
listall = wrap(listall, ['channel'])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user