Added GNU filter.

This commit is contained in:
Jeremy Fincher 2004-10-14 18:07:10 +00:00
parent b6a92fc2b6
commit dcff006235
2 changed files with 14 additions and 3 deletions

View File

@ -44,7 +44,7 @@ from cStringIO import StringIO
import supybot.conf as conf
import supybot.utils as utils
from supybot.commands import wrap
from supybot.commands import *
import supybot.ircmsgs as ircmsgs
import supybot.ircutils as ircutils
import supybot.registry as registry
@ -97,7 +97,7 @@ class Filter(callbacks.Privmsg):
_filterCommands = ['jeffk', 'leet', 'rot13', 'hexlify', 'binary', 'lithp',
'scramble', 'morse', 'reverse', 'colorize', 'squish',
'supa1337', 'colorstrip', 'aol', 'rainbow', 'spellit',
'hebrew', 'undup']
'hebrew', 'undup', 'gnu']
def outfilter(self, irc, msg, args, channel, command):
"""[<channel>] [<command>]
@ -117,7 +117,8 @@ class Filter(callbacks.Privmsg):
self.outFilters[channel] = []
irc.replySuccess()
outfilter = wrap(outfilter,
[('checkChannelCapability', 'op'), '?commandName'])
[('checkChannelCapability', 'op'),
additional('commandName')])
def hebrew(self, irc, msg, args, text):
"""<text>
@ -606,6 +607,13 @@ class Filter(callbacks.Privmsg):
irc.reply(out.getvalue())
spellit = wrap(spellit, ['text'])
def gnu(self, irc, msg, args):
"""<text>
Returns <text> as RMS would say it.
"""
irc.reply(' '.join(['GNU/' + s for s in args]))
Class = Filter

View File

@ -151,4 +151,7 @@ class FilterTest(ChannelPluginTestCase, PluginDocumentation):
s = ircmsgs.unAction(m)
self.assertEqual(s, 'sbbone')
def testGnu(self):
self.assertResponse('gnu foo bar baz', 'GNU/foo GNU/bar GNU/baz')
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: