view examples/cherrypy/index.py @ 397:31742fe6d47e trunk

* Moved some utility functions from `genshi.core` to `genshi.util` (backwards compatibility preserved via imports) * Minor performance tweaks for the serializers
author cmlenz
date Tue, 02 Jan 2007 17:48:06 +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()
Copyright (C) 2012-2017 Edgewall Software