Aka: catch with error if 'aka list' response is empty

This commit is contained in:
James Lu 2014-12-16 16:51:52 -08:00
parent f05f04807d
commit 26df32086d

View File

@ -723,10 +723,13 @@ class Aka(callbacks.Plugin):
Raise=True)
channel = arg
aka_list = self._db.get_aka_list(channel)
aka_values = [self._db.get_alias(channel, aka) for aka in aka_list]
s = ('{0}: "{1}"'.format(ircutils.bold(k), v) for (k, v) in
zip(aka_list, aka_values))
irc.replies(s)
if aka_list:
aka_values = [self._db.get_alias(channel, aka) for aka in aka_list]
s = ('{0}: "{1}"'.format(ircutils.bold(k), v) for (k, v) in
zip(aka_list, aka_values))
irc.replies(s)
else:
irc.error(_("No Akas found."))
list = wrap(list, [getopts({'channel': 'somethingWithoutSpaces'})])