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

Side by Side Diff: tools/json_schema_compiler/json_schema.py

Issue 9600050: Add IDL capability to json_schema_compiler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch Set 1 Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import json 5 import json
6 import os.path 6 import os.path
7 import sys 7 import sys
8 8
9 # We need to get json_minify from the third_party directory. 9 # We need to get json_minify from the third_party directory.
10 # This is similar to what is done in chrome/common/extensions/docs/build.py 10 # This is similar to what is done in chrome/common/extensions/docs/build.py
11 third_party_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 11 third_party_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
12 os.pardir, os.pardir, 'third_party/') 12 os.pardir, os.pardir, 'third_party/')
13 if third_party_path not in sys.path: 13 if third_party_path not in sys.path:
14 sys.path.insert(0, third_party_path) 14 sys.path.insert(0, third_party_path)
15 import json_minify as minify 15 import json_minify as minify
16 16
17 def LoadJSON(filename): 17 def Load(filename):
18 with open(filename, 'r') as handle: 18 with open(filename, 'r') as handle:
19 return json.loads(minify.json_minify(handle.read())) 19 return json.loads(minify.json_minify(handle.read()))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698