Index: chrome/common/extensions/docs/server2/samples_data_source.py |
diff --git a/chrome/common/extensions/docs/server2/samples_data_source.py b/chrome/common/extensions/docs/server2/samples_data_source.py |
index 449914bc2d3d1c73601d9c5d58fe146168a11b02..9a57fba423a1f2d1eebf76b3eb40331cbcdda94f 100644 |
--- a/chrome/common/extensions/docs/server2/samples_data_source.py |
+++ b/chrome/common/extensions/docs/server2/samples_data_source.py |
@@ -191,21 +191,9 @@ class SamplesDataSource(object): |
only the samples that use the API |api_name|. |key| is either 'apps' or |
'extensions'. |
''' |
- api_search = api_name.replace('.', '_') + '_' |
- samples_list = [] |
- try: |
- for sample in self.get(key): |
- api_calls_unix = [model.UnixName(call['name']) |
- for call in sample['api_calls']] |
- for call in api_calls_unix: |
- if call.startswith(api_search): |
- samples_list.append(sample) |
- break |
- except NotImplementedError: |
- # If we're testing, the GithubFileSystem can't fetch samples. |
- # Bug: http://crbug.com/141910 |
- return [] |
- return samples_list |
+ return [sample for sample in self.get(key) if any( |
+ call['name'].startswith(api_name + '.') |
+ for call in sample['api_calls'])] |
def _CreateSamplesDict(self, key): |
if key == 'apps': |