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

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

Issue 375133002: Docserver: Display API features that are available to content scripts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase/Address comments 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/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 f81370f84df78339051e8682abe4d9af2b2c0939..ac928f523cbcf699e402213feb79051fd18812c1 100644
--- a/chrome/common/extensions/docs/server2/docs_server_utils.py
+++ b/chrome/common/extensions/docs/server2/docs_server_utils.py
@@ -33,6 +33,12 @@ def StringIdentity(first, *more):
identity = encode(identity + m)
return identity[:8]
+def MarkFirst(dicts):
+ '''Adds a property 'first' == True to the first element in a list of dicts.
+ '''
+ if len(dicts) > 0:
+ dicts[0]['first'] = True
+
def MarkLast(dicts):
'''Adds a property 'last' == True to the last element in a list of dicts.
'''

Powered by Google App Engine
This is Rietveld 408576698