annotate examples/cherrypy/index.py @ 514:e293bbb40507

Fixed a bug where select() operated on the entire stream rather than only on the previous selection. Introduced the end() transformation to reset the current selection.
author athomas
date Wed, 06 Jun 2007 12:51:54 +0000
parents 3879c9ad3472
children
rev   line source
266
aa16cebbcfe4 Added an example CherryPy application.
cmlenz
parents:
diff changeset
1 import os
aa16cebbcfe4 Added an example CherryPy application.
cmlenz
parents:
diff changeset
2 import sys
aa16cebbcfe4 Added an example CherryPy application.
cmlenz
parents:
diff changeset
3
aa16cebbcfe4 Added an example CherryPy application.
cmlenz
parents:
diff changeset
4 import cherrypy
aa16cebbcfe4 Added an example CherryPy application.
cmlenz
parents:
diff changeset
5 from genshi.template import TemplateLoader
aa16cebbcfe4 Added an example CherryPy application.
cmlenz
parents:
diff changeset
6
aa16cebbcfe4 Added an example CherryPy application.
cmlenz
parents:
diff changeset
7 loader = TemplateLoader([os.path.dirname(os.path.abspath(__file__))])
aa16cebbcfe4 Added an example CherryPy application.
cmlenz
parents:
diff changeset
8
aa16cebbcfe4 Added an example CherryPy application.
cmlenz
parents:
diff changeset
9
aa16cebbcfe4 Added an example CherryPy application.
cmlenz
parents:
diff changeset
10 class Example(object):
aa16cebbcfe4 Added an example CherryPy application.
cmlenz
parents:
diff changeset
11
aa16cebbcfe4 Added an example CherryPy application.
cmlenz
parents:
diff changeset
12 @cherrypy.expose
aa16cebbcfe4 Added an example CherryPy application.
cmlenz
parents:
diff changeset
13 def index(self):
aa16cebbcfe4 Added an example CherryPy application.
cmlenz
parents:
diff changeset
14 tmpl = loader.load('index.html')
aa16cebbcfe4 Added an example CherryPy application.
cmlenz
parents:
diff changeset
15 return tmpl.generate(name='world').render('xhtml')
aa16cebbcfe4 Added an example CherryPy application.
cmlenz
parents:
diff changeset
16
aa16cebbcfe4 Added an example CherryPy application.
cmlenz
parents:
diff changeset
17
aa16cebbcfe4 Added an example CherryPy application.
cmlenz
parents:
diff changeset
18 if __name__ == '__main__':
432
3879c9ad3472 * Updated change log
cmlenz
parents: 266
diff changeset
19 cherrypy.quickstart(Example(), config='config.txt')
Copyright (C) 2012-2017 Edgewall Software