Mercurial > genshi > mirror
view examples/cherrypy/index.py @ 297:d87b76fdaebb trunk
Allow `when` directives to omit the test expression as long as the associated `choose` directive does have one. In that case, the `when` branch is followed if the expression of the `choose` directive evaluates to a truth value.
author | cmlenz |
---|---|
date | Fri, 13 Oct 2006 15:02:51 +0000 |
parents | 8a13cbab435e |
children | 406915754870 |
line wrap: on
line source
import os import sys import cherrypy from genshi.template import TemplateLoader loader = TemplateLoader([os.path.dirname(os.path.abspath(__file__))]) class Example(object): @cherrypy.expose def index(self): tmpl = loader.load('index.html') return tmpl.generate(name='world').render('xhtml') cherrypy.root = Example() if __name__ == '__main__': cherrypy.config.update(file='config.txt') cherrypy.server.start()