

def __init__(self, items, page=0, max_per_page=10, num_items=None):
    if (not page):
        page = 0
    if (num_items is None):
        (items, num_items, num_pages) = paginate(items, page, max_per_page)
    else:
        (items, num_items, num_pages) = prepared_paginate(items, num_items, max_per_page)
    offset = (page * max_per_page)
    self.page = page
    self.max_per_page = max_per_page
    self.items = items
    self.num_items = num_items
    self.num_pages = num_pages
    self.span = (offset, (offset + len(items)))
    self.show_index = True

dataset/ETHPy150Open edgewall/trac/trac/util/presentation.py Paginator.__init__/original