コード例 #1
0
def output_report_json(report, path):
    uid = IUUID(report)
    os.mkdir(os.path.join(path, uid))
    f = open(os.path.join(path, uid, 'report.json'), 'w+')
    f.write(ReportJSON(report).render())
    f.close()
    charts = [o for o in report.objectValues() if IBaseChart.providedBy(o)]
    for chart in charts:
        chart_name = '%s.json' % chart.getId()
        f = open(os.path.join(path, uid, chart_name), 'w+')
        f.write(ChartJSON(chart).render())
        f.close()
    return os.path.join(path, IUUID(report))
コード例 #2
0
ファイル: make_static_reports.py プロジェクト: upiq/uu.chart
def output_report_json(report, path):
    uid = IUUID(report)
    os.mkdir(os.path.join(path, uid))
    f = open(os.path.join(path, uid, 'report.json'), 'w+')
    f.write(ReportJSON(report).render())
    f.close()
    charts = [o for o in report.objectValues() if IBaseChart.providedBy(o)]
    for chart in charts:
        chart_name = '%s.json' % chart.getId()
        f = open(os.path.join(path, uid, chart_name), 'w+')
        f.write(ChartJSON(chart).render())
        f.close()
    return os.path.join(path, IUUID(report))
コード例 #3
0
def output_report_html(report, path):
    req = output_request(report)
    charts = [o for o in report.objectValues() if IBaseChart.providedBy(o)]
    for chart in charts:
        chart_name = os.path.join(path, '%s.html' % chart.getId())
        view = ChartView(chart, req)
        f = open(chart_name, 'w+')
        f.write(view().encode('utf-8'))
        f.close()
    report_name = os.path.join(path, 'index.html')
    view = ReportView(report, req)
    f = open(report_name, 'w+')
    f.write(view().encode('utf-8'))
    f.close()
コード例 #4
0
ファイル: make_static_reports.py プロジェクト: upiq/uu.chart
def output_report_html(report, path):
    req = output_request(report)
    charts = [o for o in report.objectValues() if IBaseChart.providedBy(o)]
    for chart in charts:
        chart_name = os.path.join(path, '%s.html' % chart.getId())
        view = ChartView(chart, req)
        f = open(chart_name, 'w+')
        f.write(view().encode('utf-8'))
        f.close()
    report_name = os.path.join(path, 'index.html')
    view = ReportView(report, req)
    f = open(report_name, 'w+')
    f.write(view().encode('utf-8'))
    f.close()