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

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

Issue 10639020: Switch the downloads API over to IDL/json_schema_compiler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 8 years, 5 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 a751b5a8704231323366b14166c5acb461473c8a..41d3d9ec933af6df66a018c0b92a9f4f279746bf 100644
--- a/chrome/common/extensions/docs/build/directory.py
+++ b/chrome/common/extensions/docs/build/directory.py
@@ -83,13 +83,13 @@ def parse_idl_file(path):
api_def = idl_schema.Load(path)
for namespace_def in api_def:
namespace_dot = namespace_def['namespace'] + '.'
- types = dict((type_['id'], type_)
- for type_ in namespace_def.get('types', [])
- if type_)
+ inline_types = dict((type_['id'], type_)
+ for type_ in namespace_def.get('types', [])
+ if type_ and type_.get('inline_doc', False))
def SubstituteInlineDoc(prop):
prop_ref_type = prop.get('$ref', '')
- type_obj = types.get(namespace_dot + prop_ref_type,
- types.get(prop_ref_type, {}))
+ type_obj = inline_types.get(namespace_dot + prop_ref_type,
+ inline_types.get(prop_ref_type, {}))
if not type_obj:
return
if 'properties' in type_obj:
@@ -113,17 +113,18 @@ def parse_idl_file(path):
if (prop.get('type', '') == 'array' and
prop.get('items', {}).get('$ref', '').startswith(namespace_dot)):
prop['items']['$ref'] = prop['items']['$ref'][len(namespace_dot):]
- if prop.get('inline_doc', False):
- del prop['inline_doc']
- SubstituteInlineDoc(prop)
- if 'items' in prop:
- SubstituteInlineDoc(prop['items'])
+ SubstituteInlineDoc(prop)
+ if 'items' in prop:
+ SubstituteInlineDoc(prop['items'])
for type_ in namespace_def.get('types', []):
if type_.get('id', '').startswith(namespace_dot):
type_['id'] = type_['id'][len(namespace_dot):]
for prop in type_.get('properties', {}).values():
FixReferences(prop)
+ if type_.get('inline_doc', False):
+ del type_['inline_doc']
+ type_['nodoc'] = True
for func in namespace_def.get('functions', []):
for param in func.get('parameters', []):
FixReferences(param)
« no previous file with comments | « chrome/common/extensions/api/extension_api.cc ('k') | chrome/common/extensions/docs/extensions/downloads.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698