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

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

Issue 11195055: Extensions Docs Server: Fix handling of nodocs in server2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: increment APIDataSource version Created 8 years, 2 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
« no previous file with comments | « no previous file | chrome/common/extensions/docs/server2/api_data_source_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/docs/server2/api_data_source.py
diff --git a/chrome/common/extensions/docs/server2/api_data_source.py b/chrome/common/extensions/docs/server2/api_data_source.py
index 271b7a27315df7ea8ea8cca8079054a1dcfdce6f..49421a60f7dce381f57afb087093c8fe099cf006 100644
--- a/chrome/common/extensions/docs/server2/api_data_source.py
+++ b/chrome/common/extensions/docs/server2/api_data_source.py
@@ -17,19 +17,25 @@ import third_party.json_schema_compiler.idl_parser as idl_parser
# Increment this version when there are changes to the data stored in any of
# the caches used by APIDataSource. This allows the cache to be invalidated
# without having to flush memcache on the production server.
-_VERSION = 1
+_VERSION = 2
def _RemoveNoDocs(item):
if type(item) == dict:
if item.get('nodoc', False):
return True
+ to_remove = []
for key, value in item.items():
if _RemoveNoDocs(value):
- del item[key]
+ to_remove.append(key)
+ for k in to_remove:
+ del item[k]
elif type(item) == list:
+ to_remove = []
for i in item:
if _RemoveNoDocs(i):
- item.remove(i)
+ to_remove.append(i)
+ for i in to_remove:
+ item.remove(i)
return False
def _CreateId(node, prefix):
« no previous file with comments | « no previous file | chrome/common/extensions/docs/server2/api_data_source_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698