Mercurial > genshi > mirror
annotate examples/cherrypy/index.py @ 432:406915754870 trunk
* Updated change log
* Updated CherryPy example to 3.0
author | cmlenz |
---|---|
date | Thu, 22 Mar 2007 18:54:09 +0000 |
parents | 8a13cbab435e |
children |
rev | line source |
---|---|
266 | 1 import os |
2 import sys | |
3 | |
4 import cherrypy | |
5 from genshi.template import TemplateLoader | |
6 | |
7 loader = TemplateLoader([os.path.dirname(os.path.abspath(__file__))]) | |
8 | |
9 | |
10 class Example(object): | |
11 | |
12 @cherrypy.expose | |
13 def index(self): | |
14 tmpl = loader.load('index.html') | |
15 return tmpl.generate(name='world').render('xhtml') | |
16 | |
17 | |
18 if __name__ == '__main__': | |
432 | 19 cherrypy.quickstart(Example(), config='config.txt') |