Mercurial > hg > FileServer
diff fileserver/web.py @ 20:1eb5e82605a5
* flush out README
* other minor fixes
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Wed, 29 Feb 2012 16:38:39 -0800 |
parents | 27bd18f0a359 |
children | eb15c8321ad8 |
line wrap: on
line diff
--- a/fileserver/web.py Wed Feb 29 16:15:31 2012 -0800 +++ b/fileserver/web.py Wed Feb 29 16:38:39 2012 -0800 @@ -14,7 +14,7 @@ from webob import Request, Response, exc from wsgiref.simple_server import make_server -__all__ = ['get_mimetype', 'file_response', 'FileApp', 'DirectoryServer'] +__all__ = ['get_mimetype', 'file_response', 'FileApp', 'DirectoryServer', 'main'] def get_mimetype(filename): type, encoding = mimetypes.guess_type(filename) @@ -22,6 +22,7 @@ return type or 'application/octet-stream' def file_response(filename): + """return a webob response object appropriate to a file name""" res = Response(content_type=get_mimetype(filename)) res.body = open(filename, 'rb').read() return res