Fixed bug in acronym; why did it blindly remove the first and last responses?

This commit is contained in:
Jeremy Fincher 2003-07-24 13:33:31 +00:00
parent b64e0d5730
commit fb730d72a1

View File

@ -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 -->(.*?)<a href="/up/acc', re.S)