blob: 121009ccba5ef8274b088738d5bf75a1a7a6dde4 [file] [log] [blame]
phoglund@webrtc.orgd4f0a0e2012-02-01 10:59:23 +00001#!/usr/bin/env python
2#-*- coding: utf-8 -*-
3# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
4#
5# Use of this source code is governed by a BSD-style license
6# that can be found in the LICENSE file in the root of the source
7# tree. An additional intellectual property rights grant can be found
8# in the file PATENTS. All contributing project authors may
9# be found in the AUTHORS file in the root of the source tree.
10
11"""Implements the quality tracker dashboard and reporting facilities."""
12
phoglund@webrtc.orgb64dd312012-08-10 08:57:39 +000013import math
14
phoglund@webrtc.org86ce46d2012-02-06 10:55:12 +000015from google.appengine.ext.webapp import template
phoglund@webrtc.orgd4f0a0e2012-02-01 10:59:23 +000016import webapp2
17
phoglund@webrtc.org86ce46d2012-02-06 10:55:12 +000018import load_coverage
phoglund@webrtc.orgd4f0a0e2012-02-01 10:59:23 +000019
20
21class ShowDashboard(webapp2.RequestHandler):
22 """Shows the dashboard page.
23
24 The page is shown by grabbing data we have stored previously
25 in the App Engine database using the AddCoverageData handler.
26 """
phoglund@webrtc.orgd4f0a0e2012-02-01 10:59:23 +000027 def get(self):
phoglund@webrtc.org86ce46d2012-02-06 10:55:12 +000028 coverage_loader = load_coverage.CoverageDataLoader()
phoglund@webrtc.orgfc402762012-03-12 09:12:32 +000029 small_medium_coverage_json_data = (
30 coverage_loader.load_coverage_json_data('small_medium_tests'))
31 large_coverage_json_data = (
32 coverage_loader.load_coverage_json_data('large_tests'))
phoglund@webrtc.orgd4f0a0e2012-02-01 10:59:23 +000033
phoglund@webrtc.org86ce46d2012-02-06 10:55:12 +000034 page_template_filename = 'templates/dashboard_template.html'
35 self.response.write(template.render(page_template_filename, vars()))
phoglund@webrtc.orgd4f0a0e2012-02-01 10:59:23 +000036
37 def _show_error_page(self, error_message):
38 self.response.write('<html><body>%s</body></html>' % error_message)
39