OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 | 5 import logging |
6 import os | 6 import os |
7 | 7 |
8 from file_system import FileNotFoundError | 8 from file_system import FileNotFoundError |
9 import third_party.json_schema_compiler.model as model | 9 import third_party.json_schema_compiler.model as model |
10 from docs_server_utils import SanitizeAPIName | 10 from docs_server_utils import SanitizeAPIName |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 'extensions': self._GetAPIsInSubdirectory(api_names, 'extensions') | 55 'extensions': self._GetAPIsInSubdirectory(api_names, 'extensions') |
56 } | 56 } |
57 | 57 |
58 def __getitem__(self, key): | 58 def __getitem__(self, key): |
59 return self.get(key) | 59 return self.get(key) |
60 | 60 |
61 def get(self, key): | 61 def get(self, key): |
62 try: | 62 try: |
63 return self._cache.GetFromFileListing(self._api_path)[key] | 63 return self._cache.GetFromFileListing(self._api_path)[key] |
64 except FileNotFoundError as e: | 64 except FileNotFoundError as e: |
65 logging.error(e) | 65 raise ValueError(str(e) + ': Error listing files for "%s".' % key) |
66 return None | |
OLD | NEW |