mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-17 06:00:42 +01:00
Fixed bug in acronym; why did it blindly remove the first and last responses?
This commit is contained in:
parent
b64e0d5730
commit
fb730d72a1
@ -329,12 +329,13 @@ class Http(callbacks.Privmsg):
|
|||||||
return
|
return
|
||||||
html = fd.read()
|
html = fd.read()
|
||||||
fd.close()
|
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:
|
if len(defs) == 0:
|
||||||
irc.reply(msg, 'No definitions found.')
|
irc.reply(msg, 'No definitions found.')
|
||||||
else:
|
else:
|
||||||
s = ircutils.privmsgPayload([repr(s.strip()) for s in defs[1:-1]],
|
s = ircutils.privmsgPayload(defs, ', or ')
|
||||||
', or ')
|
|
||||||
irc.reply(msg, '%s could be %s' % (acronym, s))
|
irc.reply(msg, '%s could be %s' % (acronym, s))
|
||||||
|
|
||||||
_netcraftre = re.compile(r'whatos text -->(.*?)<a href="/up/acc', re.S)
|
_netcraftre = re.compile(r'whatos text -->(.*?)<a href="/up/acc', re.S)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user