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

Unified Diff: chrome/common/extensions/docs/server2/features_utility.py

Issue 189123002: Docserver: Correctly disambiguate between what 'platform' means in a features (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup debugging Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/server2/features_utility.py
diff --git a/chrome/common/extensions/docs/server2/features_utility.py b/chrome/common/extensions/docs/server2/features_utility.py
index a9d00ef5fdb4174462d96660322c2e92f4384b07..67b538762919bd8481555428951403a99d479a24 100644
--- a/chrome/common/extensions/docs/server2/features_utility.py
+++ b/chrome/common/extensions/docs/server2/features_utility.py
@@ -65,14 +65,23 @@ def Parse(features_json):
if ignore_feature(name, value):
continue
- features[name] = { 'platforms': [] }
-
+ # Now we transform 'extension_types' into the more useful 'platforms'.
+ #
+ # But first, note that 'platforms' has a double meaning. In the docserver
+ # model (what we're in the process of generating) it means 'apps' vs
+ # 'extensions'. In the JSON features as read from Chrome it means 'win' vs
+ # 'mac'. Ignore the latter.
+ value.pop('platforms', None)
extension_types = value.pop('extension_types', None)
+
+ platforms = []
if extension_types is not None:
- features[name]['platforms'] = _GetPlatformsForExtensionTypes(
- extension_types)
+ platforms = _GetPlatformsForExtensionTypes(extension_types)
- features[name]['name'] = name
+ features[name] = {
+ 'name': name,
+ 'platforms': platforms,
+ }
features[name].update(value)
return features

Powered by Google App Engine
This is Rietveld 408576698