mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-02 15:44:06 +01:00
Fixed bug #802804 about the bad appearance of [not an acronym].
This commit is contained in:
parent
d68c42684d
commit
073040d92e
@ -332,6 +332,10 @@ class Http(callbacks.Privmsg):
|
||||
fd.close()
|
||||
# The following definitions are stripped and empties are removed.
|
||||
defs = filter(None, map(str.strip, self._acronymre.findall(html)))
|
||||
utils.sortBy(lambda s: not s.startswith('[not an acronym]'), defs)
|
||||
for (i, s) in enumerate(defs):
|
||||
if s.startswith('[not an acronym]'):
|
||||
defs[i] = s.split('is ', 1)[1]
|
||||
#debug.printf(defs)
|
||||
if len(defs) == 0:
|
||||
irc.reply(msg, 'No definitions found.')
|
||||
|
@ -54,6 +54,7 @@ class HttpTest(PluginTestCase, PluginDocumentation):
|
||||
|
||||
def testAcronym(self):
|
||||
self.assertNotError('acronym PERL')
|
||||
self.assertNotRegexp('acronym UNIX', 'not an acronym')
|
||||
|
||||
def testNetcraft(self):
|
||||
self.assertNotError('netcraft slashdot.org')
|
||||
|
Loading…
Reference in New Issue
Block a user