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

Unified Diff: tools/json_schema_compiler/compiler.py

Issue 9582013: Revert 124660 - Allow comments in extension config files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
===================================================================
--- tools/json_schema_compiler/compiler.py (revision 124674)
+++ tools/json_schema_compiler/compiler.py (working copy)
@@ -19,7 +19,7 @@
import cc_generator
import cpp_type_generator
import h_generator
-from json_schema import LoadJSON
+import json
import model
import optparse
import os.path
@@ -49,7 +49,8 @@
# Actually generate for source file.
- api_defs = LoadJSON(schema)
+ with open(schema, 'r') as schema_file:
+ api_defs = json.loads(schema_file.read())
for target_namespace in api_defs:
referenced_schemas = target_namespace.get('dependencies', [])
@@ -57,7 +58,8 @@
for referenced_schema in referenced_schemas:
referenced_schema_path = os.path.join(
os.path.dirname(schema), referenced_schema + '.json')
- referenced_api_defs = LoadJSON(referenced_schema_path)
+ with open(referenced_schema_path, 'r') as referenced_schema_file:
+ referenced_api_defs = json.loads(referenced_schema_file.read())
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