blob: 432501104d4fa557f2d99451afa7d8d13fc919a7 [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.org86ce46d2012-02-06 10:55:12 +000013from google.appengine.ext.webapp import template
phoglund@webrtc.orgd4f0a0e2012-02-01 10:59:23 +000014import webapp2
15
phoglund@webrtc.org86ce46d2012-02-06 10:55:12 +000016import load_coverage
phoglund@webrtc.orgd4f0a0e2012-02-01 10:59:23 +000017
18
19class ShowDashboard(webapp2.RequestHandler):
20 """Shows the dashboard page.
21
22 The page is shown by grabbing data we have stored previously
23 in the App Engine database using the AddCoverageData handler.
24 """
phoglund@webrtc.orgd4f0a0e2012-02-01 10:59:23 +000025 def get(self):
phoglund@webrtc.org86ce46d2012-02-06 10:55:12 +000026 coverage_loader = load_coverage.CoverageDataLoader()
phoglund@webrtc.org62b816a2013-09-16 11:26:12 +000027 # pylint: disable=W0612
phoglund@webrtc.orgfc402762012-03-12 09:12:32 +000028 small_medium_coverage_json_data = (
29 coverage_loader.load_coverage_json_data('small_medium_tests'))
phoglund@webrtc.org62b816a2013-09-16 11:26:12 +000030 # pylint: disable=W0612
phoglund@webrtc.orgfc402762012-03-12 09:12:32 +000031 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