summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfangjue23303@gmail.com <fangjue23303@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-26 00:42:34 +0000
committerfangjue23303@gmail.com <fangjue23303@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-26 00:42:34 +0000
commitd3b2a71b0c667ed4bd94ce5dd23855079a87bd45 (patch)
treef2c64f8810db172c04bab50983fba787e47a90da
parent389e6d11d752be4a5473c4b44a919c0d4f4892ea (diff)
downloadchromium_src-d3b2a71b0c667ed4bd94ce5dd23855079a87bd45.zip
chromium_src-d3b2a71b0c667ed4bd94ce5dd23855079a87bd45.tar.gz
chromium_src-d3b2a71b0c667ed4bd94ce5dd23855079a87bd45.tar.bz2
Docserver: Fix missing samples in some API reference pages
BUG=309814 R=kalman NOTRY=TRUE Review URL: https://codereview.chromium.org/38923003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231169 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/common/extensions/docs/server2/app.yaml2
-rw-r--r--chrome/common/extensions/docs/server2/cron.yaml2
-rw-r--r--chrome/common/extensions/docs/server2/samples_data_source.py18
3 files changed, 5 insertions, 17 deletions
diff --git a/chrome/common/extensions/docs/server2/app.yaml b/chrome/common/extensions/docs/server2/app.yaml
index 6637e8e..7f55026 100644
--- a/chrome/common/extensions/docs/server2/app.yaml
+++ b/chrome/common/extensions/docs/server2/app.yaml
@@ -1,5 +1,5 @@
application: chrome-apps-doc
-version: 2-32-7
+version: 2-32-8
runtime: python27
api_version: 1
threadsafe: false
diff --git a/chrome/common/extensions/docs/server2/cron.yaml b/chrome/common/extensions/docs/server2/cron.yaml
index c1d6089..9733948 100644
--- a/chrome/common/extensions/docs/server2/cron.yaml
+++ b/chrome/common/extensions/docs/server2/cron.yaml
@@ -2,4 +2,4 @@ cron:
- description: Repopulates all cached data.
url: /_cron
schedule: every 5 minutes
- target: 2-32-7
+ target: 2-32-8
diff --git a/chrome/common/extensions/docs/server2/samples_data_source.py b/chrome/common/extensions/docs/server2/samples_data_source.py
index 449914b..9a57fba 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':