diff pics2/pics_test_server.py @ 57:b7966ae653f2

pics2: add support for .webm files; add pics.fcgi and index.css
author paulo
date Tue, 14 Jan 2014 23:44:24 -0800
parents 0249782e231e
children
line diff
     1.1 --- a/pics2/pics_test_server.py	Tue Sep 10 01:04:24 2013 -0700
     1.2 +++ b/pics2/pics_test_server.py	Tue Jan 14 23:44:24 2014 -0800
     1.3 @@ -13,13 +13,19 @@
     1.4  	server.stop()
     1.5  
     1.6  
     1.7 +MIMETYPE = {
     1.8 +	".webm": "video/webm",
     1.9 +}
    1.10 +
    1.11 +
    1.12  class FileServerRoot:
    1.13  	def default(self, *args):
    1.14  		if len(args) == 0:
    1.15  			raise cherrypy.HTTPError(404)
    1.16  
    1.17  		filepath = os.path.abspath(os.path.join(*args))
    1.18 -		return cherrypy.lib.static.serve_file(filepath)
    1.19 +		ext = os.path.splitext(filepath)[1]
    1.20 +		return cherrypy.lib.static.serve_file(filepath, content_type=MIMETYPE.get(ext))
    1.21  
    1.22  	default.exposed = True
    1.23