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: |