view cherry1.py @ 23:c74245e41387

• Converted audio files to MP3 • Added disclaimer on welcome page • Changed code to handle mp3 files
author Daniele Barchiesi <daniele.barchiesi@eecs.qmul.ac.uk>
date Mon, 25 Mar 2013 13:47:06 +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())