| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 from google.appengine.datastore.datastore_query import Cursor | 5 from google.appengine.datastore.datastore_query import Cursor |
| 6 from google.appengine.ext import ndb | 6 from google.appengine.ext import ndb |
| 7 from google.appengine.ext.webapp import template | 7 from google.appengine.ext.webapp import template |
| 8 | 8 |
| 9 from model.flake import Flake | 9 from model.flake import Flake |
| 10 from status.cq_status import is_last_hour | 10 from status.util import is_last_hour |
| 11 from status.cq_status import is_last_day | 11 from status.util import is_last_day |
| 12 from status.cq_status import is_last_week | 12 from status.util import is_last_week |
| 13 from status.cq_status import is_last_month | 13 from status.util import is_last_month |
| 14 | 14 |
| 15 import datetime | 15 import datetime |
| 16 import logging | 16 import logging |
| 17 import time | 17 import time |
| 18 import webapp2 | 18 import webapp2 |
| 19 | 19 |
| 20 def FlakeSortFunction(s): # pragma: no cover | 20 def FlakeSortFunction(s): # pragma: no cover |
| 21 return s.builder + str(time.mktime(s.time_finished.timetuple())) | 21 return s.builder + str(time.mktime(s.time_finished.timetuple())) |
| 22 | 22 |
| 23 def GetFilteredOccurences(flake, time_formatter, | 23 def GetFilteredOccurences(flake, time_formatter, |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 f.filtered_occurrences = GetFilteredOccurences( | 96 f.filtered_occurrences = GetFilteredOccurences( |
| 97 f, time_formatter, filter_by_range) | 97 f, time_formatter, filter_by_range) |
| 98 | 98 |
| 99 values = { | 99 values = { |
| 100 'range': time_range, | 100 'range': time_range, |
| 101 'flakes': flakes, | 101 'flakes': flakes, |
| 102 'more': more, | 102 'more': more, |
| 103 'cursor': next_cursor.urlsafe() if next_cursor else '', | 103 'cursor': next_cursor.urlsafe() if next_cursor else '', |
| 104 } | 104 } |
| 105 self.response.write(template.render('templates/index.html', values)) | 105 self.response.write(template.render('templates/index.html', values)) |
| OLD | NEW |