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

Side by Side Diff: appengine/components/components/template.py

Issue 2013943002: Changing license header, again! (Closed) Base URL: git@github.com:luci/luci-py.git@master
Patch Set: Fixed third parties Created 4 years, 6 months 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 unified diff | Download patch
OLDNEW
1 # Copyright 2014 The LUCI Authors. All rights reserved. 1 # Copyright 2014 The LUCI Authors. All rights reserved.
2 # Use of this source code is governed by the Apache v2.0 license that can be 2 # Use of this source code is governed under the Apache License, Version 2.0
3 # found in the LICENSE file. 3 # that can be found in the LICENSE file.
4 4
5 """Setups jinja2 environment to be reused by all components and services.""" 5 """Setups jinja2 environment to be reused by all components and services."""
6 6
7 import datetime 7 import datetime
8 import os 8 import os
9 import urllib 9 import urllib
10 10
11 from components import utils 11 from components import utils
12 utils.import_jinja2() 12 utils.import_jinja2()
13 13
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 """Shorthand to render a template. 194 """Shorthand to render a template.
195 195
196 It includes default useful parameters used in most templates/base.html. 196 It includes default useful parameters used in most templates/base.html.
197 197
198 TODO(maruel): Uniformize this. 198 TODO(maruel): Uniformize this.
199 """ 199 """
200 data = _get_defaults() 200 data = _get_defaults()
201 data.update(params or {}) 201 data.update(params or {})
202 data.setdefault('now', utils.utcnow()) 202 data.setdefault('now', utils.utcnow())
203 return get_jinja_env().get_template(name).render(data) 203 return get_jinja_env().get_template(name).render(data)
OLDNEW
« no previous file with comments | « appengine/components/components/stats_framework_test.py ('k') | appengine/components/components/utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698