Index: tools/json_schema_compiler/json_schema.py |
diff --git a/tools/json_schema_compiler/json_schema.py b/tools/json_schema_compiler/json_schema.py |
index b3eca78194d66697572f3d312057a9347388b5af..9fe1ffc886c89bbea09bd233722d3082d2d1a933 100644 |
--- a/tools/json_schema_compiler/json_schema.py |
+++ b/tools/json_schema_compiler/json_schema.py |
@@ -3,20 +3,18 @@ |
# found in the LICENSE file. |
import copy |
-import json |
-import os.path |
+import os |
import sys |
-_script_path = os.path.realpath(__file__) |
-sys.path.insert(0, os.path.normpath(_script_path + "/../../")) |
-import json_comment_eater |
+from json_parse import OrderedDict, Parse |
import schema_util |
def DeleteNocompileNodes(item): |
def HasNocompile(thing): |
- return type(thing) == dict and thing.get('nocompile', False) |
+ return (isinstance(thing, (dict, OrderedDict)) and |
+ thing.get('nocompile', False)) |
- if type(item) == dict: |
+ if isinstance(item, (dict, OrderedDict)): |
toDelete = [] |
for key, value in item.items(): |
if HasNocompile(value): |
@@ -33,7 +31,7 @@ def DeleteNocompileNodes(item): |
def Load(filename): |
with open(filename, 'r') as handle: |
- schemas = json.loads(json_comment_eater.Nom(handle.read())) |
+ schemas = Parse(handle.read()) |
schema_util.PrefixSchemasWithNamespace(schemas) |
return schemas |