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

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: fixes 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_test.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..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
« no previous file with comments | « tools/json_schema_compiler/json_parse_test.py ('k') | tools/json_schema_compiler/model.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698