comparison cherry1.py @ 0:032bc65ebafc

added core components
author George Fazekas <gyorgy.fazekas@eecs.qmul.ac.uk>
date Wed, 06 Mar 2013 15:45:48 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:032bc65ebafc
1 import cherrypy
2 from cherrypy.lib.static import serve_file
3
4 class OnePage(object):
5 def index(self):
6 return "one page!"
7 index.exposed = True
8
9
10 class TwoPage(object):
11 def index(self):
12 return serve_file('/Users/tmc/write_it.txt', "audio/mpeg", "attachment")
13 index.exposed = True
14
15 class HelloWorld(object):
16 onepage = OnePage()
17 twopage = TwoPage()
18
19 def index(self):
20 return "hello world"
21 index.exposed = True
22
23 cherrypy.quickstart(HelloWorld())