Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/common.py @ 8761:0289f384e1e5
Generally replace "file name" with "filename" in help and comments.
author | timeless <timeless@gmail.com> |
---|---|
date | Tue, 09 Jun 2009 09:25:17 -0400 |
parents | 46293a0c7e9f |
children | 3b76321aa0de |
comparison
equal
deleted
inserted
replaced
8760:bf17aeafb869 | 8761:0289f384e1e5 |
---|---|
69 os.stat(path) | 69 os.stat(path) |
70 ct = mimetypes.guess_type(path)[0] or "text/plain" | 70 ct = mimetypes.guess_type(path)[0] or "text/plain" |
71 req.respond(HTTP_OK, ct, length = os.path.getsize(path)) | 71 req.respond(HTTP_OK, ct, length = os.path.getsize(path)) |
72 return file(path, 'rb').read() | 72 return file(path, 'rb').read() |
73 except TypeError: | 73 except TypeError: |
74 raise ErrorResponse(HTTP_SERVER_ERROR, 'illegal file name') | 74 raise ErrorResponse(HTTP_SERVER_ERROR, 'illegal filename') |
75 except OSError, err: | 75 except OSError, err: |
76 if err.errno == errno.ENOENT: | 76 if err.errno == errno.ENOENT: |
77 raise ErrorResponse(HTTP_NOT_FOUND) | 77 raise ErrorResponse(HTTP_NOT_FOUND) |
78 else: | 78 else: |
79 raise ErrorResponse(HTTP_SERVER_ERROR, err.strerror) | 79 raise ErrorResponse(HTTP_SERVER_ERROR, err.strerror) |