diff options
Diffstat (limited to 'tools/json_schema_compiler/json_schema.py')
-rw-r--r-- | tools/json_schema_compiler/json_schema.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/json_schema_compiler/json_schema.py b/tools/json_schema_compiler/json_schema.py index 0fa1ba5..ae126c2 100644 --- a/tools/json_schema_compiler/json_schema.py +++ b/tools/json_schema_compiler/json_schema.py @@ -3,11 +3,8 @@ # found in the LICENSE file. import copy -import os -import sys import json_parse -import schema_util def DeleteNodes(item, delete_key): """Deletes the given nodes in item, recursively, that have |delete_key| as @@ -31,15 +28,18 @@ def DeleteNodes(item, delete_key): return item + def Load(filename): with open(filename, 'r') as handle: schemas = json_parse.Parse(handle.read()) return schemas + # A dictionary mapping |filename| to the object resulting from loading the JSON # at |filename|. _cache = {} + def CachedLoad(filename): """Equivalent to Load(filename), but caches results for subsequent calls""" if filename not in _cache: |