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

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: 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 36d378073149634dc9430ea31df9b4021d36cc78..50df3a1b63f025b03ef28293b057b46473be66f3 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 = 0
+_VERSION = 1
def _RemoveNoDocs(item):
if type(item) == dict:
if item.get('nodoc', False):
Aaron Boodman 2012/10/24 22:25:02 Weird to assume that only dictionaries can have 'n
cduvall 2012/10/26 00:01:47 I don't see how a type besides a dictionary could
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