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 HTMLParser import HTMLParser | 5 from HTMLParser import HTMLParser |
6 import logging | 6 import logging |
7 import re | 7 import re |
8 | 8 |
9 from docs_server_utils import FormatKey | 9 from docs_server_utils import FormatKey |
10 from file_system import FileNotFoundError | 10 from file_system import FileNotFoundError |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 return self.get(key) | 75 return self.get(key) |
76 | 76 |
77 def get(self, key): | 77 def get(self, key): |
78 real_path = FormatKey(key) | 78 real_path = FormatKey(key) |
79 error = None | 79 error = None |
80 for base_path in self._base_paths: | 80 for base_path in self._base_paths: |
81 try: | 81 try: |
82 return self._cache.GetFromFile(base_path + '/' + real_path) | 82 return self._cache.GetFromFile(base_path + '/' + real_path) |
83 except FileNotFoundError as error: | 83 except FileNotFoundError as error: |
84 pass | 84 pass |
85 logging.error(error) | 85 raise ValueError(str(error) + ': No intro found for "%s".' % key) |
86 return None | |
OLD | NEW |