mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 19:52:54 +01:00
Fixed a bug where lookup.search would fail with an error when an invalid domain was provided.
This commit is contained in:
parent
99c412940c
commit
ad7ae52bd9
@ -355,13 +355,18 @@ class Lookup(callbacks.Privmsg):
|
|||||||
args.remove('--values')
|
args.remove('--values')
|
||||||
(options, rest) = getopt.getopt(args, '', ['regexp='])
|
(options, rest) = getopt.getopt(args, '', ['regexp='])
|
||||||
(name, globs) = privmsgs.getArgs(rest, optional=1)
|
(name, globs) = privmsgs.getArgs(rest, optional=1)
|
||||||
|
if self.db.checkLookup(name):
|
||||||
try:
|
try:
|
||||||
results = self.db.searchResults(name, options, globs, column)
|
results = self.db.searchResults(name, options, globs, column)
|
||||||
except dbi.NoRecordError:
|
|
||||||
irc.reply('No entries in %s matched that query.' % name)
|
|
||||||
lookups = ['%s: %s' % (item[0], self._shrink(item[1]))
|
lookups = ['%s: %s' % (item[0], self._shrink(item[1]))
|
||||||
for item in results]
|
for item in results]
|
||||||
irc.reply(utils.commaAndify(lookups))
|
irc.reply(utils.commaAndify(lookups))
|
||||||
|
except dbi.NoRecordError:
|
||||||
|
irc.reply('No entries in %s matched that query.' % name)
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
irc.reply('I don\'t have a domain %s' % name)
|
||||||
|
return
|
||||||
|
|
||||||
def _lookup(self, irc, msg, args):
|
def _lookup(self, irc, msg, args):
|
||||||
"""<name> <key>
|
"""<name> <key>
|
||||||
|
Loading…
Reference in New Issue
Block a user