From f3e2e2a1ed99866cfd7a90ae3b2d760a37fbb75a Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Thu, 13 Nov 2003 20:24:40 +0000 Subject: [PATCH] Added a squish command/outfilter. --- plugins/Fun.py | 11 ++++++++++- test/test_Fun.py | 4 ++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/plugins/Fun.py b/plugins/Fun.py index 105469ada..9f31c66ce 100644 --- a/plugins/Fun.py +++ b/plugins/Fun.py @@ -77,7 +77,7 @@ class Fun(callbacks.Privmsg): _filterCommands = ['jeffk', 'leet', 'rot13', 'hexlify', 'binary', 'lithp', 'scramble', 'morse', 'reverse', 'urlquote', 'md5','sha', - 'colorize'] + 'colorize', 'squish'] def outfilter(self, irc, msg, args, channel): """[] [] @@ -99,6 +99,15 @@ class Fun(callbacks.Privmsg): irc.reply(msg, conf.replySuccess) outfilter = privmsgs.checkChannelCapability(outfilter, 'op') + def squish(self, irc, msg, args): + """ + + Removes all the spaces from . + """ + text = privmsgs.getArgs(args) + text = ''.join(text.split()) + irc.reply(msg, text) + def hexip(self, irc, msg, args): """ diff --git a/test/test_Fun.py b/test/test_Fun.py index f5aa99826..fd55cc2a3 100644 --- a/test/test_Fun.py +++ b/test/test_Fun.py @@ -51,6 +51,10 @@ class FunTest(ChannelPluginTestCase, PluginDocumentation): for i in range(100): self.assertNotError('jeffk the quick brown fox is ghetto') + def testSquish(self): + self.assertResponse('squish foo bar baz', 'foobarbaz') + self.assertResponse('squish "foo bar baz"', 'foobarbaz') + def testLithp(self): self.assertResponse('lithp jamessan', 'jamethan')