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

Unified Diff: tools/json_schema_compiler/json_schema.py

Issue 11079010: Extensions Docs Server: Preserve JSON declaration order in extensions documentation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updated with the new simplejson Created 8 years, 1 month 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/model.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 b3eca78194d66697572f3d312057a9347388b5af..370bc9b3cb35b917fbbe70f712a3d3908c207ce4 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)
- 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
« no previous file with comments | « tools/json_schema_compiler/json_parse.py ('k') | tools/json_schema_compiler/model.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698