From 073040d92e958cdd0d11ccbd42b4f9ce44160104 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 9 Sep 2003 08:33:07 +0000 Subject: [PATCH] Fixed bug #802804 about the bad appearance of [not an acronym]. --- plugins/Http.py | 4 ++++ test/test_Http.py | 1 + 2 files changed, 5 insertions(+) diff --git a/plugins/Http.py b/plugins/Http.py index 9b81b31ea..a62d39263 100644 --- a/plugins/Http.py +++ b/plugins/Http.py @@ -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.') diff --git a/test/test_Http.py b/test/test_Http.py index 65a905b2c..4b84885b2 100644 --- a/test/test_Http.py +++ b/test/test_Http.py @@ -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')