From fb730d72a14a19912d471d988563aaf744854044 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Thu, 24 Jul 2003 13:33:31 +0000 Subject: [PATCH] Fixed bug in acronym; why did it blindly remove the first and last responses? --- plugins/Http.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/Http.py b/plugins/Http.py index 3b7b348ac..9f36ee5fa 100644 --- a/plugins/Http.py +++ b/plugins/Http.py @@ -329,12 +329,13 @@ class Http(callbacks.Privmsg): return html = fd.read() fd.close() - defs = self._acronymre.findall(html) + # The following definitions are stripped and empties are removed. + defs = filter(None, map(str.strip, self._acronymre.findall(html))) + debug.printf(defs) if len(defs) == 0: irc.reply(msg, 'No definitions found.') else: - s = ircutils.privmsgPayload([repr(s.strip()) for s in defs[1:-1]], - ', or ') + s = ircutils.privmsgPayload(defs, ', or ') irc.reply(msg, '%s could be %s' % (acronym, s)) _netcraftre = re.compile(r'whatos text -->(.*?)