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 import third_party.json_schema_compiler.model as model | 7 import third_party.json_schema_compiler.model as model |
9 import docs_server_utils as utils | 8 import docs_server_utils as utils |
10 | 9 |
11 class APIListDataSource(object): | 10 class APIListDataSource(object): |
12 """ This class creates a list of chrome.* APIs and chrome.experimental.* APIs | 11 """ This class creates a list of chrome.* APIs and chrome.experimental.* APIs |
13 for extensions and apps that are used in the api_index.html and | 12 for extensions and apps that are used in the api_index.html and |
14 experimental.html pages. | 13 experimental.html pages. |
15 |api_path| is the path to the API schemas. | 14 |api_path| is the path to the API schemas. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 67 |
69 def GetAllNames(self): | 68 def GetAllNames(self): |
70 names = [] | 69 names = [] |
71 for platform in ['apps', 'extensions']: | 70 for platform in ['apps', 'extensions']: |
72 for category in ['chrome', 'experimental']: | 71 for category in ['chrome', 'experimental']: |
73 names.extend(self.get(platform).get(category)) | 72 names.extend(self.get(platform).get(category)) |
74 return [api_name['name'] for api_name in names] | 73 return [api_name['name'] for api_name in names] |
75 | 74 |
76 def get(self, key): | 75 def get(self, key): |
77 return self._compiled_fs.GetFromFileListing(self._api_path)[key] | 76 return self._compiled_fs.GetFromFileListing(self._api_path)[key] |
OLD | NEW |