Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1024)

Unified Diff: appengine_apps/trooper_o_matic/appengine_module/trooper_o_matic/cq.py

Issue 774323002: Moved trooper_o_matic to appengine/ (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine_apps/trooper_o_matic/appengine_module/trooper_o_matic/cq.py
diff --git a/appengine_apps/trooper_o_matic/appengine_module/trooper_o_matic/cq.py b/appengine_apps/trooper_o_matic/appengine_module/trooper_o_matic/cq.py
deleted file mode 100644
index a1ff15f8fd6da4bafea25fce86c4c3c7fc7acb43..0000000000000000000000000000000000000000
--- a/appengine_apps/trooper_o_matic/appengine_module/trooper_o_matic/cq.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (c) 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import calendar
-import json
-import jinja2
-import os
-import webapp2
-
-from appengine_module.trooper_o_matic import controller
-
-
-JINJA_ENVIRONMENT = jinja2.Environment(
- loader=jinja2.FileSystemLoader(os.path.join(os.path.dirname(__file__),
- 'templates')),
- extensions=['jinja2.ext.autoescape'],
- autoescape=True)
-
-
-class CQHandler(webapp2.RequestHandler):
- def get(self, project):
- template = JINJA_ENVIRONMENT.get_template('cq.html')
- self.response.write(template.render({
- 'project': project
- }))
-
-
-class CQLengthJSONHandler(webapp2.RequestHandler):
- def get(self, project):
- cq_data = controller.get_cq_stats(project)
- length_cols = ['timestamp', 'length']
- length_rows = [
- [calendar.timegm(stat.timestamp.timetuple()), stat.length]
- for stat in cq_data['single_run_data']]
- length_data = {
- 'cols': length_cols,
- 'rows': length_rows,
- 'unit': 'count',
- }
-
- self.response.headers['Content-Type'] = 'application/json'
- self.response.headers['Access-Control-Allow-Origin'] = '*'
- self.response.write(json.dumps(length_data))

Powered by Google App Engine
This is Rietveld 408576698