Mercurial > genshi > genshi-test
annotate examples/bench/myghty/template.myt @ 917:bcaa91c42b97 experimental-py3k
add support for python 3 to genshi.template expression evaluator:
* add support for python 3 AST:
* AST for raise has changed in Python 3.
* Python 3 adds AST nodes for individual arguments and Bytes.
* use genshi.compat functions for dealing with code objects.
* do not coerce byte strings to unicode in Python 3 ASTTransformer.
* replace doctests that reply on exception names with uglier but more compatible try:.. except:.. doctest
* handle filename preferences of Python 2 and 3 (2 prefers bytes, 3 prefers unicode).
* ifilter is gone from itertools in Python 3 so use repeat for tests instead.
author | hodgestar |
---|---|
date | Sun, 24 Oct 2010 22:39:08 +0000 |
parents | 1f4e66680f9f |
children |
rev | line source |
---|---|
320 | 1 <%args> |
2 title | |
3 items | |
4 user | |
5 </%args> | |
6 | |
7 <head> | |
8 <title><% title %></title> | |
9 </head> | |
10 | |
11 <&|base.myt:wrap &> | |
12 <div><& base.myt:greeting, name=user &></div> | |
13 <div><& base.myt:greeting, name="me"&></div> | |
14 <div><& base.myt:greeting, name="world" &></div> | |
15 | |
16 <h2>Loop</h2> | |
17 %if items: | |
18 <ul> | |
19 % for item in items: | |
20 <li><% item %></li> | |
21 % | |
22 </ul> | |
23 % | |
24 | |
25 </&> |