def set_entries(self, entries: List[Tuple[str, str]], titles, resources):
        """ Provide the template the data for the toc entries """

        self.entries = []
        for flag, pagename in entries:
            title = titles[pagename].children[0]
            resource = resources.get(pagename, None)
            if resource and hasattr(resource,
                                    'is_published') and not \
                    resource.is_published:
                continue
            # Even if there is no resource for this tocentry, we can
            # use the toctree info
            self.entries.append(dict(
                title=title, href=pagename, resource=resource
            ))

        self.result_count = len(self.entries)
def set_entries ( self , entries : List [ Tuple [ str , str ] ] , titles , resources ) : self . entries = [ ] for flag , pagename in entries : title = titles [ pagename ] . children [ 0 ] resource = resources . get ( pagename , None ) if resource and hasattr ( resource , 'is_published' ) and not resource . is_published : continue self . entries . append ( dict ( title = title , href = pagename , resource = resource ) ) self . result_count = len ( self . entries )
Provide the template the data for the toc entries