From b6f798263bfc1ecee2fc6cd59f093a24233ace61 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sun, 28 Dec 2014 22:59:11 -0800 Subject: [PATCH] Misc: add 'clearmores' command (Closes ProgVal/Limnoria#953) --- plugins/Misc/plugin.py | 9 +++++++++ plugins/Misc/test.py | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/plugins/Misc/plugin.py b/plugins/Misc/plugin.py index c20153723..bd228da2d 100644 --- a/plugins/Misc/plugin.py +++ b/plugins/Misc/plugin.py @@ -606,6 +606,15 @@ class Misc(callbacks.Plugin): completenick = wrap(completenick, ['channel', 'something', getopts({'match-case':''})]) + @internationalizeDocstring + def clearmores(self, irc, msg, args): + """takes no arguments + + Clears all mores for the current network.""" + irc._mores.clear() + irc.replySuccess() + clearmores = wrap(clearmores, ['admin']) + Class = Misc # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: diff --git a/plugins/Misc/test.py b/plugins/Misc/test.py index 86f2981b2..9f4d34aa4 100644 --- a/plugins/Misc/test.py +++ b/plugins/Misc/test.py @@ -225,6 +225,12 @@ class MiscTestCase(ChannelPluginTestCase): self.assertIsNot(m, None) self.assertNotIn('more', m.args[1]) + def testClearMores(self): + self.assertRegexp('echo %s' % ('abc'*700), 'more') + self.assertRegexp('more', 'more') + self.assertNotError('clearmores') + self.assertError('more') + def testInvalidCommand(self): self.assertError('echo []')