phoglund@webrtc.org | d4f0a0e | 2012-02-01 10:59:23 +0000 | [diff] [blame] | 1 | #!/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.org | 86ce46d | 2012-02-06 10:55:12 +0000 | [diff] [blame] | 13 | from google.appengine.ext.webapp import template |
phoglund@webrtc.org | d4f0a0e | 2012-02-01 10:59:23 +0000 | [diff] [blame] | 14 | import webapp2 |
| 15 | |
phoglund@webrtc.org | 86ce46d | 2012-02-06 10:55:12 +0000 | [diff] [blame] | 16 | import load_coverage |
phoglund@webrtc.org | d4f0a0e | 2012-02-01 10:59:23 +0000 | [diff] [blame] | 17 | |
| 18 | |
| 19 | class 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.org | d4f0a0e | 2012-02-01 10:59:23 +0000 | [diff] [blame] | 25 | def get(self): |
phoglund@webrtc.org | 86ce46d | 2012-02-06 10:55:12 +0000 | [diff] [blame] | 26 | coverage_loader = load_coverage.CoverageDataLoader() |
phoglund@webrtc.org | 62b816a | 2013-09-16 11:26:12 +0000 | [diff] [blame] | 27 | # pylint: disable=W0612 |
phoglund@webrtc.org | fc40276 | 2012-03-12 09:12:32 +0000 | [diff] [blame] | 28 | small_medium_coverage_json_data = ( |
| 29 | coverage_loader.load_coverage_json_data('small_medium_tests')) |
phoglund@webrtc.org | 62b816a | 2013-09-16 11:26:12 +0000 | [diff] [blame] | 30 | # pylint: disable=W0612 |
phoglund@webrtc.org | fc40276 | 2012-03-12 09:12:32 +0000 | [diff] [blame] | 31 | large_coverage_json_data = ( |
| 32 | coverage_loader.load_coverage_json_data('large_tests')) |
phoglund@webrtc.org | d4f0a0e | 2012-02-01 10:59:23 +0000 | [diff] [blame] | 33 | |
phoglund@webrtc.org | 86ce46d | 2012-02-06 10:55:12 +0000 | [diff] [blame] | 34 | page_template_filename = 'templates/dashboard_template.html' |
| 35 | self.response.write(template.render(page_template_filename, vars())) |
phoglund@webrtc.org | d4f0a0e | 2012-02-01 10:59:23 +0000 | [diff] [blame] | 36 | |
| 37 | def _show_error_page(self, error_message): |
| 38 | self.response.write('<html><body>%s</body></html>' % error_message) |
| 39 | |