OLD | NEW |
1 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 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 import json | 5 import json |
6 import os | 6 import os |
7 | 7 |
8 import webapp2 | 8 import webapp2 |
9 import jinja2 | 9 import jinja2 |
10 | 10 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 -models.TreeOpenStat.timestamp).get() | 83 -models.TreeOpenStat.timestamp).get() |
84 | 84 |
85 data = {} | 85 data = {} |
86 data['timestamp'] = latest.timestamp.isoformat() | 86 data['timestamp'] = latest.timestamp.isoformat() |
87 data['num_days'] = latest.num_days | 87 data['num_days'] = latest.num_days |
88 data['percent_open'] = latest.percent_open | 88 data['percent_open'] = latest.percent_open |
89 | 89 |
90 self.response.headers['Content-Type'] = 'application/json' | 90 self.response.headers['Content-Type'] = 'application/json' |
91 self.response.headers['Access-Control-Allow-Origin'] = '*' | 91 self.response.headers['Access-Control-Allow-Origin'] = '*' |
92 self.response.write(json.dumps(data)) | 92 self.response.write(json.dumps(data)) |
OLD | NEW |