This commit is contained in:
Jeremy Fincher 2003-11-29 18:45:29 +00:00
parent e15d15f794
commit 72f93610b1
3 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,5 @@
* Fixed bug #851254, Factoids.whatis didn't work on numeric keys.
* Added the ability to turn on/off the showing of ids in FunDB * Added the ability to turn on/off the showing of ids in FunDB
excuse/insult/praise/lart. excuse/insult/praise/lart.

View File

@ -131,7 +131,7 @@ class Factoids(plugins.ChannelDBHandler, callbacks.Privmsg):
necessary if the message isn't sent in the channel itself. necessary if the message isn't sent in the channel itself.
""" """
channel = privmsgs.getChannel(msg, args) channel = privmsgs.getChannel(msg, args)
if args[-1].isdigit(): if len(args) > 1 and args[-1].isdigit():
number = args.pop() number = args.pop()
else: else:
number = '' number = ''

View File

@ -105,6 +105,9 @@ if sqlite is not None:
self.assertRegexp('search jemfinch', self.assertRegexp('search jemfinch',
'my primary author') 'my primary author')
def testWhatisOnNumbers(self):
self.assertNotError('learn 911 as emergency number')
self.assertRegexp('whatis 911', 'emergency number')
def testNotZeroIndexed(self): def testNotZeroIndexed(self):
self.assertNotError('learn foo as bar') self.assertNotError('learn foo as bar')