mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Handled the case where one factoid is returned from Factoids.search better.
This commit is contained in:
parent
8a2e50baf1
commit
23db0b7aaa
@ -396,6 +396,8 @@ class Factoids(plugins.ChannelDBHandler, callbacks.Privmsg):
|
|||||||
cursor.execute(sql, formats)
|
cursor.execute(sql, formats)
|
||||||
if cursor.rowcount == 0:
|
if cursor.rowcount == 0:
|
||||||
irc.reply(msg, 'No keys matched that query.')
|
irc.reply(msg, 'No keys matched that query.')
|
||||||
|
elif cursor.rowcount == 1:
|
||||||
|
self.whatis(irc, msg, [cursor.fetchone()[0]])
|
||||||
elif cursor.rowcount > 100:
|
elif cursor.rowcount > 100:
|
||||||
irc.reply(msg, 'More than 100 keys matched that query; '
|
irc.reply(msg, 'More than 100 keys matched that query; '
|
||||||
'please narrow your query.')
|
'please narrow your query.')
|
||||||
|
@ -102,6 +102,8 @@ if sqlite is not None:
|
|||||||
'inkedmn.*strike|strike.*inkedmn')
|
'inkedmn.*strike|strike.*inkedmn')
|
||||||
self.assertRegexp('search ke',
|
self.assertRegexp('search ke',
|
||||||
'inkedmn.*strike|strike.*inkedmn')
|
'inkedmn.*strike|strike.*inkedmn')
|
||||||
|
self.assertRegexp('search jemfinch',
|
||||||
|
'my primary author')
|
||||||
|
|
||||||
|
|
||||||
def testNotZeroIndexed(self):
|
def testNotZeroIndexed(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user