| Index: chrome/common/extensions/docs/server2/api_list_data_source.py
|
| diff --git a/chrome/common/extensions/docs/server2/api_list_data_source.py b/chrome/common/extensions/docs/server2/api_list_data_source.py
|
| index 0204d749dbcc3b5baa2fecc4142b50db98544e99..5fd607ecaed02b6bc746e9a4b1c30f802f30cf94 100644
|
| --- a/chrome/common/extensions/docs/server2/api_list_data_source.py
|
| +++ b/chrome/common/extensions/docs/server2/api_list_data_source.py
|
| @@ -17,16 +17,19 @@ class APIListDataSource(object):
|
| self._api_path = api_path + '/'
|
| self._public_path = public_path + '/'
|
|
|
| - def _ListAPIs(self, apis):
|
| - api_names = set(SanitizeAPIName(name, self._api_path) for name in apis)
|
| - public_templates = self._file_system.ReadSingle(self._public_path)
|
| - template_names = [os.path.splitext(name)[0] for name in public_templates]
|
| + def _GetAPIsInSubdirectory(self, api_names, doc_type):
|
| + public_templates = self._file_system.ReadSingle(
|
| + self._public_path + doc_type + '/')
|
| + template_names = [os.path.splitext(name)[0]
|
| + for name in public_templates]
|
| experimental_apis = []
|
| chrome_apis = []
|
| for i, template_name in enumerate(sorted(template_names)):
|
| if model.UnixName(template_name) in api_names:
|
| if template_name.startswith('experimental'):
|
| - experimental_apis.append({ 'name': template_name.replace('_', '.') })
|
| + experimental_apis.append({
|
| + 'name': template_name.replace('_', '.')
|
| + })
|
| else:
|
| chrome_apis.append({ 'name': template_name.replace('_', '.') })
|
| chrome_apis[-1]['last'] = True
|
| @@ -36,6 +39,13 @@ class APIListDataSource(object):
|
| 'experimental': experimental_apis
|
| }
|
|
|
| + def _ListAPIs(self, apis):
|
| + api_names = set(SanitizeAPIName(name, self._api_path) for name in apis)
|
| + return {
|
| + 'apps': self._GetAPIsInSubdirectory(api_names, 'apps'),
|
| + 'extensions': self._GetAPIsInSubdirectory(api_names, 'extensions')
|
| + }
|
| +
|
| def __getitem__(self, key):
|
| return self.get(key)
|
|
|
|
|