def pagination_data(self, max_number_of_links=<NUM_LIT:7>):
div, mod = divmod(max_number_of_links, <NUM_LIT:2>)<EOL>if not mod == <NUM_LIT:1>:<EOL><INDENT>msg = '<STR_LIT>'<EOL>raise ValueError(msg % max_number_of_links)<EOL><DEDENT>midpoint = (max_number_of_links - <NUM_LIT:1>) / <NUM_LIT:2><EOL>current_page = self.current_page<EOL>last_page = self.last_page<EOL>if current_page > last_page:<EOL><INDENT>raise Http404('<STR_LIT>')<EOL>current_page = last_page<EOL><DEDENT>show_link_firstpage = midpoint < current_page<EOL>show_link_previouspage = <NUM_LIT:1> < current_page<EOL>show_link_lastpage = current_page < (self.last_page - midpoint)<EOL>show_link_nextpage = current_page < last_page<EOL>extra_room_previous = midpoint - current_page<EOL>if extra_room_previous < <NUM_LIT:0>:<EOL><INDENT>extra_room_previous = <NUM_LIT:0><EOL><DEDENT>if not show_link_firstpage:<EOL><INDENT>extra_room_previous += <NUM_LIT:1><EOL><DEDENT>if not show_link_previouspage:<EOL><INDENT>extra_room_previous += <NUM_LIT:1><EOL><DEDENT>extra_room_subsequent = current_page - last_page + midpoint<EOL>extra_room_subsequent = max([extra_room_subsequent, <NUM_LIT:0>])<EOL>if not show_link_nextpage:<EOL><INDENT>extra_room_subsequent += <NUM_LIT:1><EOL><DEDENT>if not show_link_lastpage:<EOL><INDENT>extra_room_subsequent += <NUM_LIT:1><EOL><DEDENT>if self.current_page == <NUM_LIT:1>:<EOL><INDENT>yield PageLink(string=<NUM_LIT:1>, page_number=<NUM_LIT:1>, clickable=False)<EOL><DEDENT>else:<EOL><INDENT>if show_link_firstpage:<EOL><INDENT>yield PageLink(string=u"<STR_LIT>", page_number=<NUM_LIT:1>, clickable=True)<EOL><DEDENT>if show_link_previouspage:<EOL><INDENT>yield PageLink(string=u"<STR_LIT>",<EOL>page_number=self.previous_page,<EOL>clickable=True)<EOL><DEDENT><DEDENT>previous = itertools.islice(self.previous_pages_numbers(),<EOL>midpoint + extra_room_subsequent)<EOL>previous = list(previous)[::-<NUM_LIT:1>]<EOL>for page_number in previous:<EOL><INDENT>yield PageLink(string=page_number,<EOL>page_number=page_number, clickable=True)<EOL><DEDENT>if current_page != <NUM_LIT:1>:<EOL><INDENT>yield PageLink(string=current_page,<EOL>page_number=current_page, clickable=False)<EOL><DEDENT>subsequent_count = midpoint + extra_room_previous<EOL>_subsequent_pages_count = self._subsequent_pages_count<EOL>if _subsequent_pages_count < subsequent_count:<EOL><INDENT>subsequent_count = _subsequent_pages_count<EOL><DEDENT>for page_number in itertools.islice(self.subsequent_pages_numbers(),<EOL>subsequent_count):<EOL><INDENT>yield PageLink(string=page_number,<EOL>page_number=page_number, clickable=True)<EOL><DEDENT>if show_link_nextpage:<EOL><INDENT>yield PageLink(string=u"<STR_LIT>",<EOL>page_number=current_page + <NUM_LIT:1>,<EOL>clickable=True)<EOL><DEDENT>if show_link_lastpage:<EOL><INDENT>yield PageLink(string=u"<STR_LIT>",<EOL>page_number=last_page,<EOL>clickable=True)<EOL><DEDENT>
Returns a generator of tuples (string, page_number, clickable),
        where `string` is the text of the html link, `page_number` is
        the number of the page the link points to, and `clickable` is
        a boolean indicating whether the link is clickable or not.