| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 itertools import groupby | 5 from itertools import groupby |
| 6 from operator import itemgetter | 6 from operator import itemgetter |
| 7 import posixpath | 7 import posixpath |
| 8 | 8 |
| 9 from data_source import DataSource | 9 from data_source import DataSource |
| 10 from extensions_paths import JSON_TEMPLATES, PUBLIC_TEMPLATES | 10 from extensions_paths import JSON_TEMPLATES, PUBLIC_TEMPLATES |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 'id': change_id, | 29 'id': change_id, |
| 30 'type': change['type'], | 30 'type': change['type'], |
| 31 'description': change['description'], | 31 'description': change['description'], |
| 32 'version': change['version'] | 32 'version': change['version'] |
| 33 } for change_id, change in whats_new_json.iteritems()] | 33 } for change_id, change in whats_new_json.iteritems()] |
| 34 | 34 |
| 35 def _GetApiVersion(self, platform, api_name): | 35 def _GetApiVersion(self, platform, api_name): |
| 36 version = None | 36 version = None |
| 37 category = self._api_categorizer.GetCategory(platform, api_name) | 37 category = self._api_categorizer.GetCategory(platform, api_name) |
| 38 if category == 'chrome': | 38 if category == 'chrome': |
| 39 channel_info = self._availability_finder.GetApiAvailability(api_name) | 39 channel_info = self._availability_finder.GetApiAvailability( |
| 40 api_name).channel_info |
| 40 channel = channel_info.channel | 41 channel = channel_info.channel |
| 41 if channel == 'stable': | 42 if channel == 'stable': |
| 42 version = channel_info.version | 43 version = channel_info.version |
| 43 return version | 44 return version |
| 44 | 45 |
| 45 def _GenerateApiListWithVersion(self, platform): | 46 def _GenerateApiListWithVersion(self, platform): |
| 46 data = [] | 47 data = [] |
| 47 for api_name, api_model in self._api_models.IterModels(): | 48 for api_name, api_model in self._api_models.IterModels(): |
| 48 version = self._GetApiVersion(platform, api_name) | 49 version = self._GetApiVersion(platform, api_name) |
| 49 if version: | 50 if version: |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 if data is None: | 92 if data is None: |
| 92 data = self._GenerateWhatsNewDict().Get() | 93 data = self._GenerateWhatsNewDict().Get() |
| 93 self._object_store.Set('whats_new_data', data) | 94 self._object_store.Set('whats_new_data', data) |
| 94 return data | 95 return data |
| 95 | 96 |
| 96 def get(self, key): | 97 def get(self, key): |
| 97 return self._GetCachedWhatsNewData().get(key) | 98 return self._GetCachedWhatsNewData().get(key) |
| 98 | 99 |
| 99 def Cron(self): | 100 def Cron(self): |
| 100 return self._GenerateWhatsNewDict() | 101 return self._GenerateWhatsNewDict() |
| OLD | NEW |