Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(291)

Side by Side Diff: chrome/common/extensions/docs/server2/api_list_data_source.py

Issue 2738623003: Extensions: Fix DocServer assert failures. (Closed)
Patch Set: -- Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 data_source import DataSource 5 from data_source import DataSource
6 from future import Future 6 from future import Future
7 from operator import itemgetter 7 from operator import itemgetter
8 from platform_util import GetPlatforms 8 from platform_util import GetPlatforms
9 9
10 from docs_server_utils import MarkFirstAndLast, MarkLast 10 from docs_server_utils import MarkFirstAndLast, MarkLast
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 all_apis = [] 60 all_apis = []
61 for api_name, api_model in self._platform_bundle.GetAPIModels( 61 for api_name, api_model in self._platform_bundle.GetAPIModels(
62 platform).IterModels(): 62 platform).IterModels():
63 if not self._platform_bundle.GetAPICategorizer(platform).IsDocumented( 63 if not self._platform_bundle.GetAPICategorizer(platform).IsDocumented(
64 api_name): 64 api_name):
65 continue 65 continue
66 api = { 66 api = {
67 'name': api_name, 67 'name': api_name,
68 'description': api_model.description, 68 'description': api_model.description,
69 } 69 }
70
70 category = self._platform_bundle.GetAPICategorizer( 71 category = self._platform_bundle.GetAPICategorizer(
71 platform).GetCategory(api_name) 72 platform).GetCategory(api_name)
72 if category == 'chrome': 73 if category == 'chrome':
73 channel_info = self._platform_bundle.GetAvailabilityFinder( 74 channel_info = self._platform_bundle.GetAvailabilityFinder(
74 platform).GetAPIAvailability(api_name).channel_info 75 platform).GetAPIAvailability(api_name).channel_info
75 channel = channel_info.channel 76 channel = channel_info.channel
76 if channel == 'stable': 77 if channel == 'stable':
77 version = channel_info.version 78 version = channel_info.version
78 api['version'] = version 79 api['version'] = version
79 platform_dict[category][channel].append(api) 80 platform_dict[category][channel].append(api)
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 if data is None: 115 if data is None:
115 return self._GenerateAPIDict().Then(persist_and_return) 116 return self._GenerateAPIDict().Then(persist_and_return)
116 return data 117 return data
117 return self._object_store.Get('api_data').Then(return_or_generate) 118 return self._object_store.Get('api_data').Then(return_or_generate)
118 119
119 def get(self, key): 120 def get(self, key):
120 return self._GetCachedAPIData().Get().get(key) 121 return self._GetCachedAPIData().Get().get(key)
121 122
122 def Refresh(self): 123 def Refresh(self):
123 return self._GetCachedAPIData() 124 return self._GetCachedAPIData()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698