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

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

Issue 344453003: Docserver: separate models for apps and extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase/Add comment Created 6 years, 6 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
Index: chrome/common/extensions/docs/server2/api_categorizer.py
diff --git a/chrome/common/extensions/docs/server2/api_categorizer.py b/chrome/common/extensions/docs/server2/api_categorizer.py
index 5e1339e37eeba2182e5d6f441c78f763fa23e05e..1daf828635525f5a101272595088784d3d5435dd 100644
--- a/chrome/common/extensions/docs/server2/api_categorizer.py
+++ b/chrome/common/extensions/docs/server2/api_categorizer.py
@@ -13,15 +13,16 @@ class APICategorizer(object):
''' This class gets api category from documented apis.
'''
- def __init__(self, file_system, compiled_fs_factory):
+ def __init__(self, file_system, compiled_fs_factory, platform):
self._file_system = file_system
self._cache = compiled_fs_factory.Create(file_system,
self._CollectDocumentedAPIs,
APICategorizer)
+ self._platform = platform
- def _GenerateAPICategories(self, platform):
+ def _GenerateAPICategories(self):
return self._cache.GetFromFileListing(
- posixpath.join(PUBLIC_TEMPLATES, platform) + '/').Get()
+ posixpath.join(PUBLIC_TEMPLATES, self._platform) + '/').Get()
@SingleFile
def _CollectDocumentedAPIs(self, base_dir, files):
@@ -32,12 +33,12 @@ class APICategorizer(object):
for name in public_templates)
return template_names
- def GetCategory(self, platform, api_name):
+ def GetCategory(self, api_name):
'''Return the type of api.'Chrome' means the public apis,
private means the api only used by chrome, and experimental means
the apis with "experimental" prefix.
'''
- documented_apis = self._GenerateAPICategories(platform)
+ documented_apis = self._GenerateAPICategories()
if (api_name.endswith('Private') or
api_name not in documented_apis):
return 'private'
@@ -45,5 +46,5 @@ class APICategorizer(object):
return 'experimental'
return 'chrome'
- def IsDocumented(self, platform, api_name):
- return (api_name in self._GenerateAPICategories(platform))
+ def IsDocumented(self, api_name):
+ return (api_name in self._GenerateAPICategories())
« no previous file with comments | « chrome/common/extensions/api/_api_features.json ('k') | chrome/common/extensions/docs/server2/api_categorizer_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698