OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 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 logging | |
6 import mimetypes | 5 import mimetypes |
7 import posixpath | 6 import posixpath |
8 import traceback | 7 import traceback |
9 | 8 |
10 from compiled_file_system import SingleFile | 9 from compiled_file_system import SingleFile |
11 from directory_zipper import DirectoryZipper | 10 from directory_zipper import DirectoryZipper |
12 from docs_server_utils import ToUnicode | 11 from docs_server_utils import ToUnicode |
13 from file_system import FileNotFoundError | 12 from file_system import FileNotFoundError |
14 from future import All, Future | 13 from future import All, Future |
15 from path_canonicalizer import PathCanonicalizer | 14 from path_canonicalizer import PathCanonicalizer |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 futures.append(self.GetContentAndType(Join(root, f))) | 202 futures.append(self.GetContentAndType(Join(root, f))) |
204 # Also cache the extension-less version of the file if needed. | 203 # Also cache the extension-less version of the file if needed. |
205 base, ext = posixpath.splitext(f) | 204 base, ext = posixpath.splitext(f) |
206 if f != SITE_VERIFICATION_FILE and ext in self._default_extensions: | 205 if f != SITE_VERIFICATION_FILE and ext in self._default_extensions: |
207 futures.append(self.GetContentAndType(Join(root, base))) | 206 futures.append(self.GetContentAndType(Join(root, base))) |
208 # TODO(kalman): Cache .zip files for each directory (if supported). | 207 # TODO(kalman): Cache .zip files for each directory (if supported). |
209 return All(futures, except_pass=Exception, except_pass_log=True) | 208 return All(futures, except_pass=Exception, except_pass_log=True) |
210 | 209 |
211 def __repr__(self): | 210 def __repr__(self): |
212 return 'ContentProvider of <%s>' % repr(self.file_system) | 211 return 'ContentProvider of <%s>' % repr(self.file_system) |
OLD | NEW |