mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-10-14 17:59:29 +02:00
Added the "action" command and associated tests.
This commit is contained in:
parent
9ddc7c75f5
commit
c318d5e384
@ -38,6 +38,8 @@ import plugins
|
|||||||
import string
|
import string
|
||||||
|
|
||||||
import utils
|
import utils
|
||||||
|
import ircmsgs
|
||||||
|
import ircutils
|
||||||
import privmsgs
|
import privmsgs
|
||||||
import callbacks
|
import callbacks
|
||||||
|
|
||||||
@ -142,6 +144,13 @@ class Utilities(callbacks.Privmsg):
|
|||||||
"""
|
"""
|
||||||
irc.reply(msg, ' '.join(args), prefixName=False)
|
irc.reply(msg, ' '.join(args), prefixName=False)
|
||||||
|
|
||||||
|
def action(self, irc, msg, args):
|
||||||
|
"""takes any number of arguments
|
||||||
|
|
||||||
|
Returns the arguments given it, but as an action.
|
||||||
|
"""
|
||||||
|
irc.queueMsg(ircmsgs.action(ircutils.replyTo(msg), ' '.join(args)))
|
||||||
|
|
||||||
def re(self, irc, msg, args):
|
def re(self, irc, msg, args):
|
||||||
"""<regexp> <text>
|
"""<regexp> <text>
|
||||||
|
|
||||||
|
@ -65,6 +65,9 @@ class UtilitiesTestCase(PluginTestCase, PluginDocumentation):
|
|||||||
m = self.getMsg('cpustats')
|
m = self.getMsg('cpustats')
|
||||||
self.assertResponse('echo "%s"' % m.args[1], m.args[1])
|
self.assertResponse('echo "%s"' % m.args[1], m.args[1])
|
||||||
|
|
||||||
|
def testAction(self):
|
||||||
|
self.assertAction('action moos', 'moos')
|
||||||
|
|
||||||
def testRe(self):
|
def testRe(self):
|
||||||
self.assertResponse('re "m/My children/" [cpustats]', 'My children')
|
self.assertResponse('re "m/My children/" [cpustats]', 'My children')
|
||||||
self.assertResponse('re s/user/luser/g user user', 'luser luser')
|
self.assertResponse('re s/user/luser/g user user', 'luser luser')
|
||||||
|
Loading…
Reference in New Issue
Block a user