def make_html_page(self, valumap):
        """
        Builds the report as html page, using the template page from file.
        """
        logger.info('Making an html report using template %r.', self.html_template)
        fh = open(self.html_template)
        template = fh.read()
        fh.close()

        parts = []
        for sr in self.subreports:
            report_data = [item.html for item in sr.report_data if item.html]
            if report_data:
                parts.append('\n<h2>{1}</h2>\n'.format(sr.title, sr.reptext))
                parts.extend(report_data)
                parts.append('\n<hr/>')
        
        valumap['subreports'] = '\n'.join(parts) # or "\n<<NO SUBREPORT RELATED EVENTS>>\n"
        html_page = Template(template).safe_substitute(valumap)
        return TextPart(fmt='html', text=html_page, ext='html')
def make_html_page ( self , valumap ) : logger . info ( 'Making an html report using template %r.' , self . html_template ) fh = open ( self . html_template ) template = fh . read ( ) fh . close ( ) parts = [ ] for sr in self . subreports : report_data = [ item . html for item in sr . report_data if item . html ] if report_data : parts . append ( '\n<h2>{1}</h2>\n' . format ( sr . title , sr . reptext ) ) parts . extend ( report_data ) parts . append ( '\n<hr/>' ) valumap [ 'subreports' ] = '\n' . join ( parts ) html_page = Template ( template ) . safe_substitute ( valumap ) return TextPart ( fmt = 'html' , text = html_page , ext = 'html' )
Builds the report as html page, using the template page from file.