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

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

Issue 23867003: Docserver: Consolidate features caching and access. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: let's try this again, shall we? Created 7 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
Index: chrome/common/extensions/docs/server2/docs_server_utils.py
diff --git a/chrome/common/extensions/docs/server2/docs_server_utils.py b/chrome/common/extensions/docs/server2/docs_server_utils.py
index 524137ad9c924d05c17f041372d40bed27066d3c..68fc197ceb91db58cb6230bb30c0513c1afa2584 100644
--- a/chrome/common/extensions/docs/server2/docs_server_utils.py
+++ b/chrome/common/extensions/docs/server2/docs_server_utils.py
@@ -27,3 +27,9 @@ def StringIdentity(string):
'''Creates a small hash of a string.
'''
return b64encode(sha1(string).digest())[:8]
+
+def MarkLast(dicts):
+ '''Adds a property 'last' == True to the last element in a list of dicts.
+ '''
+ if len(dicts) > 0:
+ dicts[-1]['last'] = True
« no previous file with comments | « chrome/common/extensions/docs/server2/cron.yaml ('k') | chrome/common/extensions/docs/server2/features_bundle.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698