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

Unified Diff: tools/json_schema_compiler/json_schema.py

Issue 23549025: Clean up JSON Schema Compiler. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Removed enum test and added blank lines. Created 7 years, 3 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/json_parse.py ('k') | tools/json_schema_compiler/json_schema_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0fa1ba57e9669379d75f1909215dc751816fe54d..ae126c2de911251418b608558d6c5b027e81b42b 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:
« no previous file with comments | « tools/json_schema_compiler/json_parse.py ('k') | tools/json_schema_compiler/json_schema_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698