From e53d4e7f87df2f930ea0dec05ccddff645c24ada Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Sun, 7 Sep 2003 06:34:07 +0000 Subject: [PATCH] Removed less command. --- plugins/FunCommands.py | 24 +----------------------- test/test_FunCommands.py | 10 ---------- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/plugins/FunCommands.py b/plugins/FunCommands.py index 4b0d9fcac..6add1b933 100644 --- a/plugins/FunCommands.py +++ b/plugins/FunCommands.py @@ -720,34 +720,12 @@ class FunCommands(callbacks.Privmsg): _these = [str(s) for s in this.s.decode('rot13').splitlines() if s] _these.pop(0) def zen(self, irc, msg, args): - """takes no arguments. + """takes no arguments Returns one of the zen of Python statements. """ irc.reply(msg, random.sample(self._these, 1)[0]) - _lesses = {} - def less(self, irc, msg, args): - """ - - Deals out in small, IrcMsg-sized pieces. Mostly useful for - piecing-out nested commands. - """ - text = privmsgs.getArgs(args, needed=0, optional=1) - userHostmask = msg.prefix.split('!', 1)[1] - if text: - lines = textwrap.wrap(text, 400) - lines.reverse() - s = lines.pop() - self._lesses[userHostmask] = lines - irc.reply(msg, s) - else: - try: - s = self._lesses[userHostmask].pop() - irc.reply(msg, s) - except (KeyError, IndexError): # Nothing in the list or dict. - irc.error(msg, 'I have no less history for you.') - def dns(self, irc, msg, args): """ diff --git a/test/test_FunCommands.py b/test/test_FunCommands.py index d10849c97..1c15eecb8 100644 --- a/test/test_FunCommands.py +++ b/test/test_FunCommands.py @@ -102,15 +102,5 @@ class FunCommandsTest(PluginTestCase, PluginDocumentation): self.assertResponse('rpn 1 dup', 'Stack: [1, 1]') self.assertResponse('rpn 2 3 4 + -', str(2-7)) - def testLess(self): - s390 = ' '.join(['123456789']*39) - s790 = ' '.join(['123456789']*79) - self.assertNotError('less %s' % s390) - self.assertError('less') - self.assertNotError('less %s' % s790) - self.assertNotError('less') - self.assertError('less') - - # vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: