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

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

Issue 255473003: docserver: Adds "API scheduled for Chrome version..." text to dev and beta APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adds style changes and rebase Created 6 years, 7 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 8
9 import docs_server_utils as utils 9 import docs_server_utils as utils
10 10
(...skipping 15 matching lines...) Expand all
26 def __init__(self, server_instance, _): 26 def __init__(self, server_instance, _):
27 self._features_bundle = server_instance.features_bundle 27 self._features_bundle = server_instance.features_bundle
28 self._object_store = server_instance.object_store_creator.Create( 28 self._object_store = server_instance.object_store_creator.Create(
29 APIListDataSource) 29 APIListDataSource)
30 self._api_models = server_instance.api_models 30 self._api_models = server_instance.api_models
31 self._api_categorizer = server_instance.api_categorizer 31 self._api_categorizer = server_instance.api_categorizer
32 self._availability_finder = server_instance.availability_finder 32 self._availability_finder = server_instance.availability_finder
33 33
34 def _GenerateAPIDict(self): 34 def _GenerateAPIDict(self):
35 def get_channel_info(api_name): 35 def get_channel_info(api_name):
36 return self._availability_finder.GetApiAvailability(api_name) 36 return self._availability_finder.GetApiAvailability(api_name).channel_info
37 37
38 def get_api_platform(api_name): 38 def get_api_platform(api_name):
39 feature = self._features_bundle.GetAPIFeatures().Get()[api_name] 39 feature = self._features_bundle.GetAPIFeatures().Get()[api_name]
40 return feature['platforms'] 40 return feature['platforms']
41 41
42 def make_dict_for_platform(platform): 42 def make_dict_for_platform(platform):
43 platform_dict = { 43 platform_dict = {
44 'chrome': {'stable': [], 'beta': [], 'dev': [], 'trunk': []}, 44 'chrome': {'stable': [], 'beta': [], 'dev': [], 'trunk': []},
45 } 45 }
46 private_apis = [] 46 private_apis = []
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 data = self._GenerateAPIDict() 95 data = self._GenerateAPIDict()
96 self._object_store.Set('api_data', data) 96 self._object_store.Set('api_data', data)
97 return data 97 return data
98 return Future(callback=resolve) 98 return Future(callback=resolve)
99 99
100 def get(self, key): 100 def get(self, key):
101 return self._GetCachedAPIData().Get().get(key) 101 return self._GetCachedAPIData().Get().get(key)
102 102
103 def Cron(self): 103 def Cron(self):
104 return self._GetCachedAPIData() 104 return self._GetCachedAPIData()
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/server2/api_data_source_test.py ('k') | chrome/common/extensions/docs/server2/app.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698