Mercurial > hg > env-test-daniele
view cherry1.py @ 13:8261089e6f04
Changed to one single file per page
author | Daniele Barchiesi <daniele.barchiesi@eecs.qmul.ac.uk> |
---|---|
date | Wed, 13 Mar 2013 16:14:53 +0000 |
parents | 032bc65ebafc |
children |
line wrap: on
line source
import cherrypy from cherrypy.lib.static import serve_file class OnePage(object): def index(self): return "one page!" index.exposed = True class TwoPage(object): def index(self): return serve_file('/Users/tmc/write_it.txt', "audio/mpeg", "attachment") index.exposed = True class HelloWorld(object): onepage = OnePage() twopage = TwoPage() def index(self): return "hello world" index.exposed = True cherrypy.quickstart(HelloWorld())