Mercurial > genshi > mirror
comparison examples/basic/kidrun.py @ 21:b4d17897d053 trunk
* Include paths are now interpreted relative to the path of the including template. Closes #3.
* The filename is now included as first item in the `pos` tuple of stream events.
* Simplified the "basic" example so that it actually ''is'' basic.
* Added a more complex example using nested relative includes in [source:/trunk/examples/includes/ examples/includes].
author | cmlenz |
---|---|
date | Tue, 20 Jun 2006 13:05:37 +0000 |
parents | 518a8520a6e1 |
children | 1da51d718391 |
comparison
equal
deleted
inserted
replaced
20:cc92d74ce9e5 | 21:b4d17897d053 |
---|---|
4 | 4 |
5 import kid | 5 import kid |
6 | 6 |
7 def test(): | 7 def test(): |
8 base_path = os.path.dirname(os.path.abspath(__file__)) | 8 base_path = os.path.dirname(os.path.abspath(__file__)) |
9 kid.path = kid.TemplatePath([os.path.join(base_path, 'common'), | 9 kid.path = kid.TemplatePath([base_path]) |
10 os.path.join(base_path, 'module')]) | |
11 | 10 |
12 ctxt = dict(hello='<world>', hey='ZYX', bozz=None, | 11 ctxt = dict(hello='<world>', hey='ZYX', bozz=None, |
13 items=['Number %d' % num for num in range(1, 15)], | 12 items=['Number %d' % num for num in range(1, 15)], |
14 prefix='#') | 13 prefix='#') |
15 | 14 |