summaryrefslogtreecommitdiffstats
path: root/WebKitTools/QueueStatusServer/handlers/dashboard.py
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2010-05-21 16:53:46 +0100
committerKristian Monsen <kristianm@google.com>2010-05-25 10:24:15 +0100
commit6c2af9490927c3c5959b5cb07461b646f8b32f6c (patch)
treef7111b9b22befab472616c1d50ec94eb50f1ec8c /WebKitTools/QueueStatusServer/handlers/dashboard.py
parenta149172322a9067c14e8b474a53e63649aa17cad (diff)
downloadexternal_webkit-6c2af9490927c3c5959b5cb07461b646f8b32f6c.zip
external_webkit-6c2af9490927c3c5959b5cb07461b646f8b32f6c.tar.gz
external_webkit-6c2af9490927c3c5959b5cb07461b646f8b32f6c.tar.bz2
Merge WebKit at r59636: Initial merge by git
Change-Id: I59b289c4e6b18425f06ce41cc9d34c522515de91
Diffstat (limited to 'WebKitTools/QueueStatusServer/handlers/dashboard.py')
-rw-r--r--WebKitTools/QueueStatusServer/handlers/dashboard.py45
1 files changed, 42 insertions, 3 deletions
diff --git a/WebKitTools/QueueStatusServer/handlers/dashboard.py b/WebKitTools/QueueStatusServer/handlers/dashboard.py
index 80f30ec..bbb65b8 100644
--- a/WebKitTools/QueueStatusServer/handlers/dashboard.py
+++ b/WebKitTools/QueueStatusServer/handlers/dashboard.py
@@ -26,16 +26,55 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+import operator
+
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from model.attachment import Attachment
+from model.queues import queues
+
class Dashboard(webapp.RequestHandler):
- def get(self):
- attachments = Attachment.recent(limit=25)
+ # FIXME: This list probably belongs as part of a Queue object in queues.py
+ # Arrays are bubble_name, queue_name
+ # FIXME: Can this be unified with StatusBubble._queues_to_display?
+ _queues_to_display = [
+ ["Style", "style-queue"],
+ ["Cr-Linux", "chromium-ews"],
+ ["Cr-Win", "cr-win-ews"],
+ ["Qt", "qt-ews"],
+ ["Gtk", "gtk-ews"],
+ ["Mac", "mac-ews"],
+ ["Win", "win-ews"],
+ ["Commit", "commit-queue"],
+ ]
+ # Split the zipped list into component parts
+ _header_names, _ordered_queue_names = zip(*_queues_to_display)
+
+ # This asserts that all of the queues listed above are valid queue names.
+ assert(reduce(operator.and_, map(lambda name: name in queues, _ordered_queue_names)))
+
+ def _build_bubble(self, attachment, queue_name):
+ queue_status = attachment.status_for_queue(queue_name)
+ bubble = {
+ "status_class": attachment.state_from_queue_status(queue_status) if queue_status else "none",
+ "status_date": queue_status.date if queue_status else None,
+ }
+ return bubble
+
+ def _build_row(self, attachment):
+ row = {
+ "bug_id": attachment.bug_id(),
+ "attachment_id": attachment.id,
+ "bubbles": [self._build_bubble(attachment, queue_name) for queue_name in self._ordered_queue_names],
+ }
+ return row
+
+ def get(self):
template_values = {
- "summaries" : [attachment.summary() for attachment in attachments],
+ "headers": self._header_names,
+ "rows": [self._build_row(attachment) for attachment in Attachment.recent(limit=25)],
}
self.response.out.write(template.render("templates/dashboard.html", template_values))