| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Skia Telemetry pages.""" | 5 """Skia Telemetry pages.""" |
| 6 | 6 |
| 7 | 7 |
| 8 import base64 | 8 import base64 |
| 9 import collections |
| 9 import datetime | 10 import datetime |
| 10 import json | 11 import json |
| 11 import urllib2 | 12 import urllib2 |
| 12 | 13 |
| 13 from google.appengine.ext import db | 14 from google.appengine.ext import db |
| 14 | 15 |
| 15 from base_page import BasePage | 16 from base_page import BasePage |
| 16 import utils | 17 import utils |
| 17 | 18 |
| 18 | 19 |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 self.is_admin) | 629 self.is_admin) |
| 629 | 630 |
| 630 lua_tasks = LuaTasks.get_all_lua_tasks_of_user(self.user.email()) | 631 lua_tasks = LuaTasks.get_all_lua_tasks_of_user(self.user.email()) |
| 631 template_values['lua_tasks'] = lua_tasks | 632 template_values['lua_tasks'] = lua_tasks |
| 632 template_values['oldest_pending_task_key'] = get_oldest_pending_task_key() | 633 template_values['oldest_pending_task_key'] = get_oldest_pending_task_key() |
| 633 template_values['pagesets_to_builds'] = get_skp_pagesets_to_builds() | 634 template_values['pagesets_to_builds'] = get_skp_pagesets_to_builds() |
| 634 | 635 |
| 635 self.DisplayTemplate('lua_script.html', template_values) | 636 self.DisplayTemplate('lua_script.html', template_values) |
| 636 | 637 |
| 637 | 638 |
| 639 class GetSKPRepos(BasePage): |
| 640 """Returns the recently-created SKP repositories in JSON format.""" |
| 641 def get(self): |
| 642 self.response.headers['Content-Type'] = 'application/json' |
| 643 repos = get_skp_pagesets_to_builds() |
| 644 rv = collections.defaultdict(list) |
| 645 for pageset, builds in repos.iteritems(): |
| 646 for chrome_rev, skia_rev, dt in builds: |
| 647 rv[pageset].append((chrome_rev, skia_rev, dt.__str__())) |
| 648 json.dump(rv, self.response.out) |
| 649 |
| 650 |
| 638 class ChromiumBuildsPage(BasePage): | 651 class ChromiumBuildsPage(BasePage): |
| 639 """Allows users to add and delete new chromium builds to the framework.""" | 652 """Allows users to add and delete new chromium builds to the framework.""" |
| 640 | 653 |
| 641 @utils.require_user | 654 @utils.require_user |
| 642 def get(self): | 655 def get(self): |
| 643 return self._handle() | 656 return self._handle() |
| 644 | 657 |
| 645 @utils.require_user | 658 @utils.require_user |
| 646 def post(self): | 659 def post(self): |
| 647 # Check if this is a delete chromium build request. | 660 # Check if this is a delete chromium build request. |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1266 completed_time=datetime.datetime.now()).put() | 1279 completed_time=datetime.datetime.now()).put() |
| 1267 | 1280 |
| 1268 if db.GqlQuery('SELECT __key__ FROM AdminTasks').get() is None: | 1281 if db.GqlQuery('SELECT __key__ FROM AdminTasks').get() is None: |
| 1269 AdminTasks( | 1282 AdminTasks( |
| 1270 username='Admin', | 1283 username='Admin', |
| 1271 task_name='Initial Table Creation', | 1284 task_name='Initial Table Creation', |
| 1272 pagesets_type='Test type', | 1285 pagesets_type='Test type', |
| 1273 requested_time=datetime.datetime.now(), | 1286 requested_time=datetime.datetime.now(), |
| 1274 completed_time=datetime.datetime.now()).put() | 1287 completed_time=datetime.datetime.now()).put() |
| 1275 | 1288 |
| OLD | NEW |