Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(826)

Unified Diff: chrome/common/extensions/docs/server2/api_list_data_source.py

Issue 10834144: Extensions Docs Server: Split apps from extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clean up Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/common/extensions/docs/server2/branch_utility.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « no previous file | chrome/common/extensions/docs/server2/branch_utility.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698