| 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 from path_utils import FormatKey | 5 from path_utils import FormatKey |
| 6 from third_party.handlebar import Handlebar | 6 from third_party.handlebar import Handlebar |
| 7 | 7 |
| 8 EXTENSIONS_URL = '/chrome/extensions' | 8 EXTENSIONS_URL = '/chrome/extensions' |
| 9 | 9 |
| 10 class TemplateDataSource(object): | 10 class TemplateDataSource(object): |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 'static': self._static_resources | 60 'static': self._static_resources |
| 61 }).text | 61 }).text |
| 62 | 62 |
| 63 def __getitem__(self, key): | 63 def __getitem__(self, key): |
| 64 return self.get(key) | 64 return self.get(key) |
| 65 | 65 |
| 66 def get(self, key): | 66 def get(self, key): |
| 67 real_path = FormatKey(key) | 67 real_path = FormatKey(key) |
| 68 for base_path in self._base_paths: | 68 for base_path in self._base_paths: |
| 69 try: | 69 try: |
| 70 return self._cache.getFromFile(base_path + '/' + real_path) | 70 return self._cache.GetFromFile(base_path + '/' + real_path) |
| 71 except: | 71 except Exception: |
| 72 pass | 72 pass |
| 73 return None | 73 return None |
| OLD | NEW |