[llvm-commits] [LNT] r165442 - in /lnt/trunk/lnt/server/ui: app.py filters.py globals.py
Daniel Dunbar
daniel at zuster.org
Mon Oct 8 16:02:35 PDT 2012
Author: ddunbar
Date: Mon Oct 8 18:02:35 2012
New Revision: 165442
URL: http://llvm.org/viewvc/llvm-project?rev=165442&view=rev
Log:
lnt.server.ui: Change register functions to just operate on Jinja environment.
Modified:
lnt/trunk/lnt/server/ui/app.py
lnt/trunk/lnt/server/ui/filters.py
lnt/trunk/lnt/server/ui/globals.py
Modified: lnt/trunk/lnt/server/ui/app.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/app.py?rev=165442&r1=165441&r2=165442&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/app.py (original)
+++ lnt/trunk/lnt/server/ui/app.py Mon Oct 8 18:02:35 2012
@@ -86,7 +86,7 @@
app = App(__name__)
# Register additional filters.
- lnt.server.ui.filters.register(app)
+ lnt.server.ui.filters.register(app.jinja_env)
# Set up strict undefined mode for templates.
app.jinja_env.undefined = jinja2.StrictUndefined
@@ -121,7 +121,7 @@
app=current_app,
old_config=self.old_config)
- lnt.server.ui.globals.register(self)
+ lnt.server.ui.globals.register(self.jinja_env)
# Set the application secret key.
self.secret_key = self.old_config.secretKey
Modified: lnt/trunk/lnt/server/ui/filters.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/filters.py?rev=165442&r1=165441&r2=165442&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/filters.py (original)
+++ lnt/trunk/lnt/server/ui/filters.py Mon Oct 8 18:02:35 2012
@@ -32,7 +32,7 @@
def filter_timedelta(start_time):
return "%.2fs" % (time.time() - start_time)
-def register(app):
+def register(env):
for name,object in globals().items():
if name.startswith('filter_'):
- app.jinja_env.filters[name[7:]] = object
+ env.filters[name[7:]] = object
Modified: lnt/trunk/lnt/server/ui/globals.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/globals.py?rev=165442&r1=165441&r2=165442&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/globals.py (original)
+++ lnt/trunk/lnt/server/ui/globals.py Mon Oct 8 18:02:35 2012
@@ -18,12 +18,11 @@
return flask.url_for(*args, db_name=flask.g.db_name,
testsuite_name=flask.g.testsuite_name, **kwargs)
-def register(app):
+def register(env):
# Add some normal Python builtins which can be useful in templates.
- app.jinja_env.globals.update(
- zip=zip)
+ env.globals.update(zip=zip)
# Add our custom global functions.
- app.jinja_env.globals.update(
+ env.globals.update(
db_url_for=db_url_for,
v4_url_for=v4_url_for)
More information about the llvm-commits
mailing list