| 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 logging | 5 import logging |
| 6 | 6 |
| 7 from branch_utility import BranchUtility | 7 from branch_utility import BranchUtility |
| 8 from docs_server_utils import FormatKey | 8 from docs_server_utils import FormatKey |
| 9 import compiled_file_system as compiled_fs | 9 import compiled_file_system as compiled_fs |
| 10 from file_system import FileNotFoundError | 10 from file_system import FileNotFoundError |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 return render_data.text | 140 return render_data.text |
| 141 | 141 |
| 142 def get(self, key): | 142 def get(self, key): |
| 143 return self.GetTemplate(self._private_template_path, key) | 143 return self.GetTemplate(self._private_template_path, key) |
| 144 | 144 |
| 145 def GetTemplate(self, base_path, template_name): | 145 def GetTemplate(self, base_path, template_name): |
| 146 real_path = FormatKey(template_name) | 146 real_path = FormatKey(template_name) |
| 147 try: | 147 try: |
| 148 return self._cache.GetFromFile(base_path + '/' + real_path) | 148 return self._cache.GetFromFile(base_path + '/' + real_path) |
| 149 except FileNotFoundError as e: | 149 except FileNotFoundError as e: |
| 150 logging.info(e) | 150 logging.warning('Template %s in %s not found: %s' % ( |
| 151 template_name, base_path, e)) |
| 151 return None | 152 return None |
| OLD | NEW |