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

Unified Diff: tools/json_schema_compiler/idl_schema.py

Issue 12996003: Dynamically generate a heading for Extension Docs API pages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updates to HasAPI in APIDataSource Created 7 years, 9 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: tools/json_schema_compiler/idl_schema.py
diff --git a/tools/json_schema_compiler/idl_schema.py b/tools/json_schema_compiler/idl_schema.py
index 4c79c30efaa159b17bc41951407e6ee624f83c9c..8f36cc1422f3e556596aced776b51689150d4529 100644
--- a/tools/json_schema_compiler/idl_schema.py
+++ b/tools/json_schema_compiler/idl_schema.py
@@ -308,7 +308,7 @@ class Namespace(object):
'''
def __init__(self, namespace_node, nodoc=False, permissions=None,
- internal=False):
+ internal=False, description=None, availability=None):
not at google - send to devlin 2013/04/04 05:19:23 Sorry to bring this up at this late point, but I d
self.namespace = namespace_node
self.nodoc = nodoc
self.internal = internal
@@ -317,6 +317,8 @@ class Namespace(object):
self.types = []
self.callbacks = OrderedDict()
self.permissions = permissions or []
+ self.description = description
+ self.availability = availability
def process(self):
for node in self.namespace.children:
@@ -334,6 +336,8 @@ class Namespace(object):
else:
sys.exit('Did not process %s %s' % (node.cls, node))
return {'namespace': self.namespace.GetName(),
+ 'description': self.description,
+ 'availability': self.availability,
'nodoc': self.nodoc,
'documentation_permissions_required': self.permissions,
'types': self.types,
@@ -363,16 +367,21 @@ class IDLSchema(object):
nodoc = False
internal = False
permissions = None
+ description = None
+ availability = None
for node in self.idl:
if node.cls == 'Namespace':
- namespace = Namespace(node, nodoc, permissions, internal)
+ namespace = Namespace(node, nodoc, permissions, internal, description,
+ availability)
namespaces.append(namespace.process())
nodoc = False
internal = False
elif node.cls == 'Copyright':
continue
elif node.cls == 'Comment':
- continue
+ description = node.GetName()
+ if description == '':
+ description = None
elif node.cls == 'ExtAttribute':
if node.name == 'nodoc':
nodoc = bool(node.value)
@@ -380,6 +389,8 @@ class IDLSchema(object):
permission = node.value.split(',')
elif node.name == 'internal':
internal = bool(node.value)
+ elif node.name == 'availability':
+ availability = node.value
else:
continue
else:

Powered by Google App Engine
This is Rietveld 408576698