Made the output of osuemail a little bit cleaner.

This commit is contained in:
Jeremy Fincher 2003-08-24 20:58:11 +00:00
parent 30711266a7
commit 577e7517af

View File

@ -248,10 +248,12 @@ class OSU(callbacks.Privmsg):
line.strip() line.strip()
if 'Published address' in line: if 'Published address' in line:
emails.append(line.split()[-1]) emails.append(line.split()[-1])
if emails: if len(emails) == 0:
irc.reply(msg, 'Possible matches: %s' % ', '.join(emails))
else:
irc.reply(msg, 'There seem to be no matches to that name.') irc.reply(msg, 'There seem to be no matches to that name.')
elif len(emails) == 1:
irc.reply(msg, emails[0])
else:
irc.reply(msg, 'Possible matches: %s' % ', '.join(emails))
except Exception, e: except Exception, e:
irc.error(msg, debug.exnToString(e)) irc.error(msg, debug.exnToString(e))