Fixed bug #802804 about the bad appearance of [not an acronym].

This commit is contained in:
Jeremy Fincher 2003-09-09 08:33:07 +00:00
parent d68c42684d
commit 073040d92e
2 changed files with 5 additions and 0 deletions

View File

@ -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.')

View File

@ -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')