mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Added GNU filter.
This commit is contained in:
parent
b6a92fc2b6
commit
dcff006235
@ -44,7 +44,7 @@ from cStringIO import StringIO
|
|||||||
|
|
||||||
import supybot.conf as conf
|
import supybot.conf as conf
|
||||||
import supybot.utils as utils
|
import supybot.utils as utils
|
||||||
from supybot.commands import wrap
|
from supybot.commands import *
|
||||||
import supybot.ircmsgs as ircmsgs
|
import supybot.ircmsgs as ircmsgs
|
||||||
import supybot.ircutils as ircutils
|
import supybot.ircutils as ircutils
|
||||||
import supybot.registry as registry
|
import supybot.registry as registry
|
||||||
@ -97,7 +97,7 @@ class Filter(callbacks.Privmsg):
|
|||||||
_filterCommands = ['jeffk', 'leet', 'rot13', 'hexlify', 'binary', 'lithp',
|
_filterCommands = ['jeffk', 'leet', 'rot13', 'hexlify', 'binary', 'lithp',
|
||||||
'scramble', 'morse', 'reverse', 'colorize', 'squish',
|
'scramble', 'morse', 'reverse', 'colorize', 'squish',
|
||||||
'supa1337', 'colorstrip', 'aol', 'rainbow', 'spellit',
|
'supa1337', 'colorstrip', 'aol', 'rainbow', 'spellit',
|
||||||
'hebrew', 'undup']
|
'hebrew', 'undup', 'gnu']
|
||||||
def outfilter(self, irc, msg, args, channel, command):
|
def outfilter(self, irc, msg, args, channel, command):
|
||||||
"""[<channel>] [<command>]
|
"""[<channel>] [<command>]
|
||||||
|
|
||||||
@ -117,7 +117,8 @@ class Filter(callbacks.Privmsg):
|
|||||||
self.outFilters[channel] = []
|
self.outFilters[channel] = []
|
||||||
irc.replySuccess()
|
irc.replySuccess()
|
||||||
outfilter = wrap(outfilter,
|
outfilter = wrap(outfilter,
|
||||||
[('checkChannelCapability', 'op'), '?commandName'])
|
[('checkChannelCapability', 'op'),
|
||||||
|
additional('commandName')])
|
||||||
|
|
||||||
def hebrew(self, irc, msg, args, text):
|
def hebrew(self, irc, msg, args, text):
|
||||||
"""<text>
|
"""<text>
|
||||||
@ -606,6 +607,13 @@ class Filter(callbacks.Privmsg):
|
|||||||
irc.reply(out.getvalue())
|
irc.reply(out.getvalue())
|
||||||
spellit = wrap(spellit, ['text'])
|
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
|
Class = Filter
|
||||||
|
|
||||||
|
@ -151,4 +151,7 @@ class FilterTest(ChannelPluginTestCase, PluginDocumentation):
|
|||||||
s = ircmsgs.unAction(m)
|
s = ircmsgs.unAction(m)
|
||||||
self.assertEqual(s, 'sbbone')
|
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:
|
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
||||||
|
Loading…
Reference in New Issue
Block a user