(self, results, pagenum, pagelen=10)
:param results: a :class:`~whoosh.searching.Results` object.
        :param pagenum: which page of the results to use, numbered from ``1``.
        :param pagelen: the number of hits per page.
:param results: a :class:`~whoosh.searching.Results` object.
        :param pagenum: which page of the results to use, numbered from ``1``.
        :param pagelen: the number of hits per page.
: param results : a : class : ~whoosh . searching . Results object . : param pagenum : which page of the results to use numbered from 1 . : param pagelen : the number of hits per page .
def __init__(self, results, pagenum, pagelen=10):
        """
        :param results: a :class:`~whoosh.searching.Results` object.
        :param pagenum: which page of the results to use, numbered from ``1``.
        :param pagelen: the number of hits per page.
        """

        self.results = results
        self.total = len(results)

        if pagenum < 1:
            raise ValueError("pagenum must be >= 1")

        self.pagecount = int(ceil(self.total / pagelen))
        self.pagenum = min(self.pagecount, pagenum)

        offset = (self.pagenum - 1) * pagelen
        if (offset + pagelen) > self.total:
            pagelen = self.total - offset
        self.offset = offset
        self.pagelen = pagelen
def __init__ ( self , results , pagenum , pagelen = 10 ) : self . results = results self . total = len ( results ) if pagenum < 1 : raise ValueError ( "pagenum must be >= 1" ) self . pagecount = int ( ceil ( self . total / pagelen ) ) self . pagenum = min ( self . pagecount , pagenum ) offset = ( self . pagenum - 1 ) * pagelen if ( offset + pagelen ) > self . total : pagelen = self . total - offset self . offset = offset self . pagelen = pagelen