src/dirbs/reports/base_operator_country.py
def gen_html_report(self, data, css_filename, js_filename):
        """Generates an HTML report from a generated data dictionary.

        Returns an encoded byte array that can be written to disk.
        """
        chart_keys = ['has_data', 'end_date', 'historic_imei_counts', 'historic_imsi_counts',
                      'historic_msisdn_counts', 'compliance_breakdown', 'historic_compliance_breakdown',
                      'classification_conditions', 'conditions_breakdown', 'historic_conditions_breakdown']
        chart_data = {k: v for k, v in data.items() if k in chart_keys}
        chart_json = json.dumps(chart_data, cls=JSONEncoder)

        context = {
            'css': css_filename,
            'js': js_filename,
            'chart_json': chart_json,
            'data': data,
            'title': self.report_title
        }

        template = self.template_env.get_template(self.template_name)
        html = template.render(context)
        return html.encode('utf-8')
Generates an HTML report from a generated data dictionary.

        Returns an encoded byte array that can be written to disk.
        
Generates an HTML report from a generated data dictionary.
Returns an encoded byte array that can be written to disk.
Generates an HTML report from a generated data dictionary . Returns an encoded byte array that can be written to disk .
def gen_html_report(self, data, css_filename, js_filename):
        chart_keys = ['has_data', 'end_date', 'historic_imei_counts', 'historic_imsi_counts',
                      'historic_msisdn_counts', 'compliance_breakdown', 'historic_compliance_breakdown',
                      'classification_conditions', 'conditions_breakdown', 'historic_conditions_breakdown']
        chart_data = {k: v for k, v in data.items() if k in chart_keys}
        chart_json = json.dumps(chart_data, cls=JSONEncoder)
        context = {
            'css': css_filename,
            'js': js_filename,
            'chart_json': chart_json,
            'data': data,
            'title': self.report_title
        }
        template = self.template_env.get_template(self.template_name)
        html = template.render(context)
        return html.encode('utf-8')
def gen_html_report ( self , data , css_filename , js_filename ) : chart_keys = [ 'has_data' , 'end_date' , 'historic_imei_counts' , 'historic_imsi_counts' , 'historic_msisdn_counts' , 'compliance_breakdown' , 'historic_compliance_breakdown' , 'classification_conditions' , 'conditions_breakdown' , 'historic_conditions_breakdown' ] chart_data = { k : v for k , v in data . items ( ) if k in chart_keys } chart_json = json . dumps ( chart_data , cls = JSONEncoder ) context = { 'css' : css_filename , 'js' : js_filename , 'chart_json' : chart_json , 'data' : data , 'title' : self . report_title } template = self . template_env . get_template ( self . template_name ) html = template . render ( context ) return html . encode ( 'utf-8' )
Generates an HTML report from a generated data dictionary.
Generates an HTML report from a generated data dictionary .
"""Generates an HTML report from a generated data dictionary.

        Returns an encoded byte array that can be written to disk.
        """
self
data
css_filename
js_filename