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 | |
6 import os | 5 import os |
7 | 6 |
8 from file_system import FileNotFoundError | 7 from file_system import FileNotFoundError |
9 import third_party.json_schema_compiler.model as model | 8 import third_party.json_schema_compiler.model as model |
10 import docs_server_utils as utils | 9 import docs_server_utils as utils |
11 | 10 |
12 # Increment this if the data model changes for APIDataSource. | 11 # Increment this if the data model changes for APIDataSource. |
13 _VERSION = 1 | 12 _VERSION = 1 |
14 | 13 |
15 # These files are special cases that shouldn't be in the API list. | 14 # These files are special cases that shouldn't be in the API list. |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 for platform in ['apps', 'extensions']: | 81 for platform in ['apps', 'extensions']: |
83 for category in ['chrome', 'experimental']: | 82 for category in ['chrome', 'experimental']: |
84 names.extend(self.get(platform).get(category)) | 83 names.extend(self.get(platform).get(category)) |
85 return [api_name['name'] for api_name in names] | 84 return [api_name['name'] for api_name in names] |
86 | 85 |
87 def get(self, key): | 86 def get(self, key): |
88 try: | 87 try: |
89 return self._compiled_fs.GetFromFileListing(self._api_path)[key] | 88 return self._compiled_fs.GetFromFileListing(self._api_path)[key] |
90 except FileNotFoundError as e: | 89 except FileNotFoundError as e: |
91 raise ValueError('%s: Error listing files for "%s".' % (e, key)) | 90 raise ValueError('%s: Error listing files for "%s".' % (e, key)) |
OLD | NEW |