Beispiel #1
0
    def build_css(self):
        """ Build the report css file """

        css_replaces = self.get_replacements('css')

        self.css_path = r'%s' % self.config['TEMPLATES']['css']
        self.check_path('css_path')
        self.css = Template(self.css_path, css_replaces + [self.special])
        self.css.write(dest=osjoin(self.setup_path, 'css',
                                   '%s.css' % self.report_filename),
                       bonus=self.js_css)
Beispiel #2
0
    def build_navbar(self):
        """ Build the top level navbar menu for the report """

        self.html_dict['NAVBAR'] = ''
        if 'navbar' in self.config.get('TEMPLATES').keys():
            self.navbar_path = self.config['TEMPLATES']['navbar']
            self.check_path('navbar_path')
            if os.path.exists(self.navbar_path):
                nav_replaces = self.get_replacements('navbar')
                self.navbar = Template(self.navbar_path,
                                       nav_replaces + [self.special])
                self.html_dict['NAVBAR'] = self.navbar.write()
Beispiel #3
0
    def build_html(self):
        """ Build the html report file """

        # Populate the html replacement dictionary
        self.html_dict['SIDEBAR'] = self.files.ul
        self.html_dict['JS_FILES'], self.js_files, self.js_css = \
            self.get_javascript(self.config['JAVASCRIPT']['files'])

        # Load the html template and build
        self.html_path = r'%s' % self.config['TEMPLATES']['html']
        self.check_path('html_path')
        self.html = Template(self.html_path, [self.html_dict, self.special])
        self.html.write(dest=osjoin(self.report_path, '%s.html' %
                                    self.report_filename))