irc3.plugins.pager Paginate large output


# -*- coding: utf-8 -*-
import irc3
import requests
from irc3.plugins.command import command

class SendFile(object):

    requires = [

    def __init__(self, bot): = bot

    def cat(self, mask, target, args):
        """Cat a file with pagination

        fd = open(__file__)
        for msg in, fd, lines_per_page=10):
            yield msg

    def url(self, mask, target, args):
        """Cat an url with pagination

            %%url <url>
        def iterator(url):
            resp = requests.get(url)
            for chunk in resp.iter_content(255):
                yield chunk.decode('utf8')
        for msg in, iterator(args['<url>'])):
            yield msg


class irc3.plugins.pager.Paginate(context)[source]

Pagination plugin