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

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

Issue 386443003: Docserver: Add 'deprecated since' message for API nodes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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/availability_finder.py
diff --git a/chrome/common/extensions/docs/server2/availability_finder.py b/chrome/common/extensions/docs/server2/availability_finder.py
index 63245f29819bd128c58e9a83f874110051d46295..28da5a4206335c5cdd4a61f64c67e2bb571a0b3e 100644
--- a/chrome/common/extensions/docs/server2/availability_finder.py
+++ b/chrome/common/extensions/docs/server2/availability_finder.py
@@ -4,6 +4,7 @@
import posixpath
+from api_data_source import _NODE_CATEGORIES
from api_schema_graph import APISchemaGraph
from branch_utility import BranchUtility, ChannelInfo
from compiled_file_system import CompiledFileSystem, SingleFile, Unicode
@@ -202,7 +203,7 @@ class AvailabilityFinder(object):
# The _api_features.json file first appears in version 28 and should be
# the most reliable for finding API availability.
available_channel = _GetChannelFromAPIFeatures(api_name,
- features_bundle)
+ features_bundle)
if version >= _ORIGINAL_FEATURES_MIN_VERSION:
# The _permission_features.json and _manifest_features.json files are
# present in Chrome 20 and onwards. Use these if no information could be
@@ -365,7 +366,7 @@ class AvailabilityFinder(object):
file_system,
channel_info.version))
availability_graph.Update(version_graph.Subtract(availability_graph),
- annotation=channel_info)
+ annotation=AvailabilityInfo(channel_info))
previous.stat = version_stat
previous.graph = version_graph
@@ -378,5 +379,20 @@ class AvailabilityFinder(object):
self.GetAPIAvailability(api_name).channel_info,
update_availability_graph)
+ # Check if any top-level nodes are scheduled.
not at google - send to devlin 2014/07/17 20:30:06 wait when does this logic kick in?
ahernandez 2014/07/17 20:35:24 This happens right after the graph is constructed.
not at google - send to devlin 2014/07/17 20:47:21 I guess i mean why do you need to add this now
ahernandez 2014/07/17 20:50:01 Oh, did you want that in a separate patch? That pr
not at google - send to devlin 2014/07/17 20:57:31 If you don't need it for this patch then yeah.
+ graph = availability_graph._graph
+ for category in _NODE_CATEGORIES:
+ if category in graph[api_name]:
+ for node in graph[api_name][category].iterkeys():
+ annotation = graph[api_name][category][node]._annotation
+ if annotation.channel_info.channel != 'stable':
+ scheduled = self._FindScheduled('%s.%s' % (api_name, node))
+ if scheduled is not None:
+ # Do not change the existing annotation object, but create
+ # a new one because multiple nodes may share the same old
+ # annotation object.
+ graph[api_name][category][node]._annotation = AvailabilityInfo(
+ annotation.channel_info, scheduled = scheduled)
+
self._node_level_object_store.Set(api_name, availability_graph)
return availability_graph

Powered by Google App Engine
This is Rietveld 408576698