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

Unified Diff: tools/json_schema_compiler/idl_schema.py

Issue 39113003: Docserver: Display enum value descriptions in API docs. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 2 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 44a4a55eaec8e06523919a621c9e450aeaa6637e..325c2bcefd3eeefb39357bc2c6c98d4e72c40b50 100644
--- a/tools/json_schema_compiler/idl_schema.py
+++ b/tools/json_schema_compiler/idl_schema.py
@@ -292,7 +292,13 @@ class Enum(object):
enum = []
for node in self.node.children:
if node.cls == 'EnumItem':
- enum.append(node.GetName())
+ enum_value = {'name': node.GetName()}
+ for child in node.children:
+ if child.cls == 'Comment':
+ enum_value['description'] = ProcessComment(child.GetName())[0]
+ else:
+ sys.exit('Did not process %s %s' % (child.cls, child))
not at google - send to devlin 2013/10/28 18:00:25 sys.exit to signal errors!? (aware that other plac
Sam McNally 2013/10/29 00:39:02 Done.
+ enum.append(enum_value)
elif node.cls == 'Comment':
self.description = ProcessComment(node.GetName())[0]
else:

Powered by Google App Engine
This is Rietveld 408576698