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

Unified Diff: tools/json_schema_compiler/previewserver.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 | « 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
===================================================================
--- tools/json_schema_compiler/previewserver.py (revision 124674)
+++ tools/json_schema_compiler/previewserver.py (working copy)
@@ -11,7 +11,7 @@
import cpp_type_generator
import cpp_util
import h_generator
-from json_schema import LoadJSON
+import json
import model
import optparse
import os
@@ -188,7 +188,8 @@
try:
# Get main json file
- api_defs = LoadJSON(json_file_path)
+ with open(json_file_path) as json_file:
+ api_defs = json.loads(json_file.read())
namespace = api_model.AddNamespace(api_defs[0], json_file_path)
if not namespace:
body.Append("<pre>Target file %s is marked nocompile</pre>" %
@@ -200,7 +201,8 @@
# Get json file depedencies
for dependency in api_defs[0].get('dependencies', []):
json_file_path = os.path.join(filedir, dependency + '.json')
- api_defs = LoadJSON(json_file_path)
+ with open(json_file_path) as json_file:
+ api_defs = json.loads(json_file.read())
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