Chromium Code Reviews| Index: chrome/common/extensions/docs/server2/api_list_data_source.py |
| diff --git a/chrome/common/extensions/docs/server2/api_list_data_source.py b/chrome/common/extensions/docs/server2/api_list_data_source.py |
| index 63d8aa3a3c819cf43c6977522b3e7c035611e85d..de937e6a4f0ad7ae8f98b7f9c3b670434fd3f7de 100644 |
| --- a/chrome/common/extensions/docs/server2/api_list_data_source.py |
| +++ b/chrome/common/extensions/docs/server2/api_list_data_source.py |
| @@ -16,8 +16,14 @@ class APIListDataSource(object): |
| self._api_path = api_path + '/' |
| self._public_path = public_path + '/' |
| + def _SanitizeAPIName(self, name): |
| + filename = os.path.splitext(name)[0][len(self._api_path):].replace('/', '_') |
| + if 'experimental' in filename: |
| + filename = 'experimental_' + filename.replace('experimental_', '') |
| + return filename |
|
not at google - send to devlin
2012/07/30 08:17:20
This will have to play well with things like
- lin
cduvall
2012/07/31 18:41:45
This is not used for handling $refs, this is just
|
| + |
| def _ListAPIs(self, apis): |
| - api_names = set(os.path.splitext(name)[0] for name in apis) |
| + api_names = set(self._SanitizeAPIName(name) for name in apis) |
| public_templates = self._file_system.ReadSingle(self._public_path) |
| template_names = [os.path.splitext(name)[0] for name in public_templates] |
| experimental_apis = [] |
| @@ -40,6 +46,6 @@ class APIListDataSource(object): |
| def get(self, key): |
| try: |
| - return self._cache.GetFromFile(self._api_path)[key] |
| + return self._cache.GetFromFileListing(self._api_path)[key] |
| except Exception as e: |
| return None |