diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cherry1.py	Wed Mar 06 15:45:48 2013 +0000
@@ -0,0 +1,23 @@
+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())
\ No newline at end of file