| OLD | NEW |
| 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 | 6 import os |
| 7 | 7 |
| 8 from handlebar_dict_generator import HandlebarDictGenerator | 8 from handlebar_dict_generator import HandlebarDictGenerator |
| 9 import third_party.json_schema_compiler.json_comment_eater as json_comment_eater | 9 import third_party.json_schema_compiler.json_comment_eater as json_comment_eater |
| 10 import third_party.json_schema_compiler.model as model | 10 import third_party.json_schema_compiler.model as model |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 def __getitem__(self, key): | 33 def __getitem__(self, key): |
| 34 return self.get(key) | 34 return self.get(key) |
| 35 | 35 |
| 36 def get(self, key): | 36 def get(self, key): |
| 37 path, ext = os.path.splitext(key) | 37 path, ext = os.path.splitext(key) |
| 38 unix_name = model.UnixName(path) | 38 unix_name = model.UnixName(path) |
| 39 json_path = unix_name + '.json' | 39 json_path = unix_name + '.json' |
| 40 idl_path = unix_name + '.idl' | 40 idl_path = unix_name + '.idl' |
| 41 try: | 41 try: |
| 42 return self._json_cache.get(self._base_path + '/' + json_path) | 42 return self._json_cache.getFromFile(self._base_path + '/' + json_path) |
| 43 except: | 43 except: |
| 44 try: | 44 try: |
| 45 return self._idl_cache.get(self._base_path + '/' + idl_path) | 45 return self._idl_cache.getFromFile(self._base_path + '/' + idl_path) |
| 46 except: | 46 except: |
| 47 pass | 47 return None |
| 48 return None | |
| OLD | NEW |