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

Unified Diff: tools/json_schema_compiler/idl_schema.py

Issue 1015033003: [Extension API Extern Generation] Auto-generate enums (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tests! Created 5 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 31e0a273233eec50e23cd85ba7471f3593657984..7364800ee2437ab25445d08166d497b93397cffd 100755
--- a/tools/json_schema_compiler/idl_schema.py
+++ b/tools/json_schema_compiler/idl_schema.py
@@ -471,6 +471,16 @@ def Load(filename):
contents = f.read()
f.close()
+ return Process(contents, filename)
+
+
+def Process(contents, filename):
+ '''
+ Processes the contents of a file and returns an equivalent Python dictionary
+ in a format that the JSON schema compiler expects to see. (Separate from
+ Load primarily for testing purposes.)
+ '''
+
idl = idl_parser.IDLParser().ParseData(contents, filename)
idl_schema = IDLSchema(idl)
return idl_schema.process()
« no previous file with comments | « no previous file | tools/json_schema_compiler/js_externs_generator.py » ('j') | tools/json_schema_compiler/js_externs_generator.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698