From b8621f0c349ee97eca30717c3f24891643dd0d0c Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Sun, 24 Oct 2004 03:04:29 +0000 Subject: [PATCH] Fixed shrink command. --- plugins/Filter.py | 5 +++-- test/test_Filter.py | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/Filter.py b/plugins/Filter.py index 242da945e..c0f14c61a 100644 --- a/plugins/Filter.py +++ b/plugins/Filter.py @@ -619,7 +619,7 @@ class Filter(callbacks.Privmsg): irc.reply(' '.join(['GNU/' + s for s in text.split()])) gnu = wrap(gnu, ['text']) - def shrink(self, irc, msg, args): + def shrink(self, irc, msg, args, text): """ Returns with each word longer than @@ -628,11 +628,12 @@ class Filter(callbacks.Privmsg): """ L = [] minimum = self.registryValue('shrink.minimum', msg.args[0]) - for word in args: + for word in text.split(): if len(word) >= minimum: word = '%s%s%s' % (word[0], len(word)-2, word[-1]) L.append(word) irc.reply(' '.join(L)) + shrink = wrap(shrink, ['text']) Class = Filter diff --git a/test/test_Filter.py b/test/test_Filter.py index f95f7d79f..1b1bd2c43 100644 --- a/test/test_Filter.py +++ b/test/test_Filter.py @@ -160,5 +160,6 @@ class FilterTest(ChannelPluginTestCase, PluginDocumentation): def testShrink(self): self.assertResponse('shrink I love you', 'I l2e you') self.assertResponse('shrink internationalization', 'i18n') + self.assertResponse('shrink "I love you"', 'I l2e you') # vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: