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

Unified Diff: chrome/common/extensions/docs/build/directory.py

Issue 9309114: Allow "internal" APIs to be specified in extension API schemas. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 10 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/build/directory.py
diff --git a/chrome/common/extensions/docs/build/directory.py b/chrome/common/extensions/docs/build/directory.py
index 53bb52193fe61f0c03e255729ac07939467728bb..316e0d633bc4a1f19e96281c510c4af2afd9857f 100644
--- a/chrome/common/extensions/docs/build/directory.py
+++ b/chrome/common/extensions/docs/build/directory.py
@@ -107,7 +107,8 @@ class ApiManifest(object):
"chrome.tabs.onDetached" : "tabs.html#event-onDetatched"
}
- If the API namespace is defined "nodoc" then an empty dict is returned.
+ If the API namespace is defined "nodoc" or "internal" then an empty dict
+ is returned.
Raises:
Exception: If the key supplied is not a member of _MODULE_DOC_KEYS.
@@ -115,14 +116,14 @@ class ApiManifest(object):
methods = []
api_dict = {}
namespace = module['namespace']
- if module.has_key('nodoc'):
+ if self._disableDocs(module):
return api_dict
if key not in self._MODULE_DOC_KEYS:
raise Exception("key %s must be one of %s" % (key, self._MODULE_DOC_KEYS))
if module.has_key(key):
methods.extend(module[key])
for method in methods:
- if method.has_key('nodoc'):
+ if self._disableDocs(method):
continue
method_name = 'chrome.%s.%s' % (namespace, method['name'])
hashprefix = 'method'
@@ -136,9 +137,15 @@ class ApiManifest(object):
Returns:
The namespace """
- # Exclude modules with a "nodoc" property.
+ # Exclude modules with documentation disabled.
return set(module['namespace'].encode() for module in self._manifest
- if "nodoc" not in module)
+ if not self._disableDocs(module))
+
+ def _disableDocs(self, obj):
+ for key in ['nodoc', 'internal']:
+ if key in obj and obj[key]:
+ return True
+ return False
def getDocumentationLinks(self):
""" Parses the extension API JSON manifest and returns a dict of all

Powered by Google App Engine
This is Rietveld 408576698