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

Unified Diff: tools/json_schema_compiler/compiler.py

Issue 9447090: Allow comments in extension config files. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed up license headers to pass license tests 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
« no previous file with comments | « third_party/json_minify/minify_json.py ('k') | tools/json_schema_compiler/cpp_type_generator_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/compiler.py
diff --git a/tools/json_schema_compiler/compiler.py b/tools/json_schema_compiler/compiler.py
index 54ab62f81c278b861332e3c30df8a7a6f717d35b..fb84a6ca461d72964a9e618aa05de265722f1871 100644
--- a/tools/json_schema_compiler/compiler.py
+++ b/tools/json_schema_compiler/compiler.py
@@ -19,7 +19,7 @@ Usage example:
import cc_generator
import cpp_type_generator
import h_generator
-import json
+from json_schema import LoadJSON
import model
import optparse
import os.path
@@ -49,8 +49,7 @@ if __name__ == '__main__':
# Actually generate for source file.
- with open(schema, 'r') as schema_file:
- api_defs = json.loads(schema_file.read())
+ api_defs = LoadJSON(schema)
for target_namespace in api_defs:
referenced_schemas = target_namespace.get('dependencies', [])
@@ -58,8 +57,7 @@ if __name__ == '__main__':
for referenced_schema in referenced_schemas:
referenced_schema_path = os.path.join(
os.path.dirname(schema), referenced_schema + '.json')
- with open(referenced_schema_path, 'r') as referenced_schema_file:
- referenced_api_defs = json.loads(referenced_schema_file.read())
+ referenced_api_defs = LoadJSON(referenced_schema_path)
for namespace in referenced_api_defs:
api_model.AddNamespace(namespace,
« no previous file with comments | « third_party/json_minify/minify_json.py ('k') | tools/json_schema_compiler/cpp_type_generator_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698