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

Unified Diff: chrome/common/extensions/docs/build/directory.py

Issue 9447090: Allow comments in extension config files. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed up license headers to pass license tests Created 8 years, 10 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 | « chrome/common/extensions/api/windows.json ('k') | chrome/common/extensions/docs/js/api_page_generator.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/docs/build/directory.py
diff --git a/chrome/common/extensions/docs/build/directory.py b/chrome/common/extensions/docs/build/directory.py
index 316e0d633bc4a1f19e96281c510c4af2afd9857f..6f49bcfa02d3d78b0b7b87a7ddfccb0cfce45893 100644
--- a/chrome/common/extensions/docs/build/directory.py
+++ b/chrome/common/extensions/docs/build/directory.py
@@ -12,6 +12,7 @@ import re
import hashlib
import zipfile
import simplejson as json
+import json_minify as minify
# Make sure we get consistent string sorting behavior by explicitly using the
# default C locale.
@@ -48,7 +49,8 @@ def parse_json_file(path, encoding="utf-8"):
raise Exception("Failed to read the file at %s: %s" % (path, msg))
try:
- json_obj = json.load(json_file, encoding)
+ json_str = json_file.read()
+ json_obj = json.loads(minify.json_minify(json_str), encoding)
except ValueError, msg:
raise Exception("Failed to parse JSON out of file %s: %s" % (path, msg))
finally:
« no previous file with comments | « chrome/common/extensions/api/windows.json ('k') | chrome/common/extensions/docs/js/api_page_generator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698