OLD | NEW |
| (Empty) |
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 | |
3 # found in the LICENSE file. | |
4 | |
5 import json | |
6 import os.path | |
7 import sys | |
8 | |
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 | |
11 third_party_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), | |
12 os.pardir, os.pardir, 'third_party/') | |
13 if third_party_path not in sys.path: | |
14 sys.path.insert(0, third_party_path) | |
15 import json_minify as minify | |
16 | |
17 def LoadJSON(filename): | |
18 with open(filename, 'r') as handle: | |
19 return json.loads(minify.json_minify(handle.read())) | |
OLD | NEW |