Mercurial > genshi > mirror
view examples/cherrypy/index.py @ 586:3670ea49c65a trunk
Fixes for nonlocal variable access in code blocks, as well as nested function and class definitions.
author | cmlenz |
---|---|
date | Wed, 08 Aug 2007 22:21:21 +0000 |
parents | 406915754870 |
children |
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') if __name__ == '__main__': cherrypy.quickstart(Example(), config='config.txt')