Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: gae/content_type.py

Issue 1150463002: [chrome-devtools-frontend] Migrate to cloudstorage client (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/chrome-devtools-frontend
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gae/config.py ('k') | gae/file_reader.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import os 5 import os
6 6
7 # W0232: 15,0:ContentHelper: Class has no __init__ method 7 # W0232: 15,0:ContentHelper: Class has no __init__ method
8 # pylint: disable=W0232 8 # pylint: disable=W0232
9 class ContentHelper: 9 class ContentHelper:
10 content_extensions = { 10 content_extensions = {
11 '.html' : 'text/html', 11 '.html' : 'text/html',
12 '.jpg' : 'image/jpeg', 12 '.jpg' : 'image/jpeg',
13 '.gif' : 'image/gif', 13 '.gif' : 'image/gif',
14 '.png' : 'image/png', 14 '.png' : 'image/png',
15 '.js' : 'application/x-javascript', 15 '.js' : 'application/x-javascript',
16 '.css' : 'text/css', 16 '.css' : 'text/css',
17 '.manifest': 'text/cache-manifest' } 17 '.manifest': 'text/cache-manifest',
18 '.zip' : 'application/zip' }
18 19
19 @staticmethod 20 @staticmethod
20 def content_type_from_path(path): 21 def content_type_from_path(path):
21 _, extension = os.path.splitext(path) 22 _, extension = os.path.splitext(path)
22 return ContentHelper.content_extensions.get(extension, 'text/plain') 23 return ContentHelper.content_extensions.get(extension, 'text/plain')
23 24
24 def from_path(path): 25 def from_path(path):
25 return ContentHelper.content_type_from_path(path) 26 return ContentHelper.content_type_from_path(path)
OLDNEW
« no previous file with comments | « gae/config.py ('k') | gae/file_reader.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698