Chromium Code Reviews| Index: appengine/config_service/handlers.py |
| diff --git a/appengine/config_service/handlers.py b/appengine/config_service/handlers.py |
| index 3a6e135477939404fbabc8a086c5f0171803e6e0..48292a6497c3890b0b8d47d6beb21c84d8d9c255 100644 |
| --- a/appengine/config_service/handlers.py |
| +++ b/appengine/config_service/handlers.py |
| @@ -5,6 +5,7 @@ |
| import httplib |
| import webapp2 |
| +import jinja2 |
| from components import decorators |
| from components.config.proto import service_config_pb2 |
| @@ -13,7 +14,12 @@ import common |
| import gitiles_import |
| import notifications |
| import storage |
| +import os |
|
Sergey Berezin
2017/06/16 20:25:23
nit: 2 empty lines between top-level statements, h
ayanaadylova
2017/06/16 21:34:46
Done.
|
| +JINJA_ENVIRONMENT = jinja2.Environment( |
| + loader=jinja2.FileSystemLoader(os.path.dirname(__file__)), |
| + extensions=['jinja2.ext.autoescape'], |
| + autoescape=True) |
|
Sergey Berezin
2017/06/16 20:25:23
nit: 2 empty lines
ayanaadylova
2017/06/16 21:34:46
Done.
|
| class CronGitilesImport(webapp2.RequestHandler): |
| """Imports configs from Gitiles.""" |
| @@ -29,6 +35,16 @@ class MainPageHandler(webapp2.RequestHandler): |
| self.redirect('_ah/api/explorer') |
| +class UIHandler(webapp2.RequestHandler): |
| + """This is the temporary handler for the new ui until we |
| + are ready to deploy this on the main url (luci-config.appspot.com). |
|
Sergey Berezin
2017/06/16 20:25:23
nit: even if temporary, I'd remove the reference t
ayanaadylova
2017/06/16 21:34:46
Done.
|
| + This handler can be accessed at luci-config.appspot.com/newui""" |
| + |
| + def get(self): |
| + template = JINJA_ENVIRONMENT.get_template('ui/index.html') |
|
Sergey Berezin
2017/06/16 20:25:23
ui/index.html doesn't seem to use any jinja templa
ayanaadylova
2017/06/16 21:34:46
I am using jinja to render a template because it i
Ryan Tseng
2017/06/16 22:08:01
Swarming uses jinja to inject the Google Analytics
|
| + self.response.write(template.render()) |
| + |
| + |
| class SchemasHandler(webapp2.RequestHandler): |
| """Redirects to a known schema definition.""" |
| @@ -51,6 +67,7 @@ class SchemasHandler(webapp2.RequestHandler): |
| def get_frontend_routes(): # pragma: no cover |
| return [ |
| webapp2.Route(r'/', MainPageHandler), |
| + webapp2.Route(r'/newui', UIHandler), |
| webapp2.Route(r'/schemas/<name:.+>', SchemasHandler), |
| webapp2.Route(r'/_ah/bounce', notifications.BounceHandler), |
| ] |