Mercurial > genshi > mirror
changeset 103:0f246a30d3a7 trunk
benchmark: improved functionality of SimpleTAL example. Thanks to bruno desthuilliers for some tips.
author | cmlenz |
---|---|
date | Wed, 26 Jul 2006 08:50:09 +0000 |
parents | e20a153cc20c |
children | f12e7987d7f4 |
files | examples/bench/basic.py examples/bench/simpletal/template.html |
diffstat | 2 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/examples/bench/basic.py +++ b/examples/bench/basic.py @@ -108,7 +108,7 @@ template = simpleTAL.compileHTMLTemplate(fileobj) fileobj.close() def render(): - ctxt = simpleTALES.Context() + ctxt = simpleTALES.Context(allowPythonPath=1) ctxt.addGlobal('base', base) ctxt.addGlobal('title', 'Just a test') ctxt.addGlobal('user', 'joe')
--- a/examples/bench/simpletal/template.html +++ b/examples/bench/simpletal/template.html @@ -20,7 +20,8 @@ <h2>Loop</h2> <ul tal:condition="items"> - <li tal:repeat="item items" tal:content="item">Item</li> + <li tal:repeat="item items" tal:content="item" + tal:attributes="class python:repeat['item'].getEnd() and 'last' or None">Item</li> </ul> </div>