1
# gozerbot/plugs/rest.py
5
__author__ = "Wijnand 'tehmaze' Modderman - http://tehmaze.com"
9
from gozerbot.commands import cmnds
10
from gozerbot.plughelp import plughelp
11
from gozerbot.examples import examples
12
from gozerbot.tests import tests
17
plughelp.add('rest', 'show rest of the output in /msg')
19
def handle_rest(bot, ievent):
21
""" show rest of the output in /msg. """
31
what, size = bot.less.more(who, 0)
34
ievent.reply('no more data available for %s' % who)
37
if not bot.jabber and int(size)+1 > 10:
38
ievent.reply("showing %d of %d lines in private" % \
41
ievent.reply("showing %d lines in private" % (int(size)+1))
51
bot.say(ievent.userhost, "%s (+%s)" % (what, size))
53
bot.say(ievent.userhost, what)
56
bot.output(ievent.nick, "%s (+%s)" % (what, size))
58
bot.output(ievent.nick, what)
64
what, size = bot.less.more(who, 0)
68
# let the user know if we have remaining data
74
bot.say(ievent.userhost, "%s more line%s" % (size, s))
76
bot.output(ievent.nick, "%s more line%s" % (size, s))
78
cmnds.add('rest', handle_rest, 'USER')
79
examples.add('rest', 'show the rest of output cache data', 'rest')
80
tests.add('avail | rest')