Mercurial > genshi > genshi-test
comparison examples/basic/run.py @ 21:eca77129518a
* 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 | ad63ad459524 |
children | b0fd16111f2e |
comparison
equal
deleted
inserted
replaced
20:e3d3c1d8c98a | 21:eca77129518a |
---|---|
7 | 7 |
8 from markup.template import Context, TemplateLoader | 8 from markup.template import Context, TemplateLoader |
9 | 9 |
10 def test(): | 10 def test(): |
11 base_path = os.path.dirname(os.path.abspath(__file__)) | 11 base_path = os.path.dirname(os.path.abspath(__file__)) |
12 loader = TemplateLoader([os.path.join(base_path, 'common'), | 12 loader = TemplateLoader([base_path], auto_reload=True) |
13 os.path.join(base_path, 'module')], | |
14 auto_reload=True) | |
15 | 13 |
16 start = datetime.now() | 14 start = datetime.now() |
17 tmpl = loader.load('test.html') | 15 tmpl = loader.load('test.html') |
18 print ' --> parse stage: ', datetime.now() - start | 16 print ' --> parse stage: ', datetime.now() - start |
19 | 17 |