Chromium Code Reviews| 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..606332277ca58f595ba84c1dee6c9514a5980fac 100644 |
| --- a/tools/json_schema_compiler/json_schema.py |
| +++ b/tools/json_schema_compiler/json_schema.py |
| @@ -3,20 +3,17 @@ |
| # 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 |
| +import json_parse |
| import schema_util |
| def DeleteNocompileNodes(item): |
| def HasNocompile(thing): |
| - return type(thing) == dict and thing.get('nocompile', False) |
| + return (json_parse.IsDict(thing) and thing.get('nocompile', False)) |
|
not at google - send to devlin
2012/11/17 05:55:16
parens unnecessary?
cduvall
2012/11/19 20:53:41
Done.
|
| - if type(item) == dict: |
| + if json_parse.IsDict(item): |
| toDelete = [] |
| for key, value in item.items(): |
| if HasNocompile(value): |
| @@ -33,7 +30,7 @@ def DeleteNocompileNodes(item): |
| def Load(filename): |
| with open(filename, 'r') as handle: |
| - schemas = json.loads(json_comment_eater.Nom(handle.read())) |
| + schemas = json_parse.Parse(handle.read()) |
| schema_util.PrefixSchemasWithNamespace(schemas) |
| return schemas |