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

Unified Diff: tools/json_schema_compiler/previewserver.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 | « tools/json_schema_compiler/model_test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/previewserver.py
diff --git a/tools/json_schema_compiler/previewserver.py b/tools/json_schema_compiler/previewserver.py
index 384171e9e64a4b9a6716dd978b7608b1f8449cb6..8a6f6ab3bcec22a09459257a5bdf7d0928398eea 100755
--- a/tools/json_schema_compiler/previewserver.py
+++ b/tools/json_schema_compiler/previewserver.py
@@ -11,7 +11,7 @@ import code
import cpp_type_generator
import cpp_util
import h_generator
-import json
+from json_schema import LoadJSON
import model
import optparse
import os
@@ -188,8 +188,7 @@ updateEverything();
try:
# Get main json file
- with open(json_file_path) as json_file:
- api_defs = json.loads(json_file.read())
+ api_defs = LoadJSON(json_file_path)
namespace = api_model.AddNamespace(api_defs[0], json_file_path)
if not namespace:
body.Append("<pre>Target file %s is marked nocompile</pre>" %
@@ -201,8 +200,7 @@ updateEverything();
# Get json file depedencies
for dependency in api_defs[0].get('dependencies', []):
json_file_path = os.path.join(filedir, dependency + '.json')
- with open(json_file_path) as json_file:
- api_defs = json.loads(json_file.read())
+ api_defs = LoadJSON(json_file_path)
referenced_namespace = api_model.AddNamespace(api_defs[0],
json_file_path)
if referenced_namespace:
« no previous file with comments | « tools/json_schema_compiler/model_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698