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

Side by Side Diff: chrome/common/extensions/docs/server2/persistent_object_store.py

Issue 12996003: Dynamically generate a heading for Extension Docs API pages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comments - Patch currently being broken up Created 7 years, 6 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 unified diff | Download patch
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 from appengine_wrappers import db, IsDevServer 5 from appengine_wrappers import db, IsDevServer
6 from datastore_models import PersistentObjectStoreItem 6 from datastore_models import PersistentObjectStoreItem
7 from future import Future 7 from future import Future
8 import logging
9 from object_store import ObjectStore 8 from object_store import ObjectStore
10 9
11 class _AsyncGetFuture(object): 10 class _AsyncGetFuture(object):
12 def __init__(self, object_store, keys): 11 def __init__(self, object_store, keys):
13 self._futures = dict( 12 self._futures = dict(
14 (k, db.get_async( 13 (k, db.get_async(
15 PersistentObjectStoreItem.CreateKey(object_store._namespace, k))) 14 PersistentObjectStoreItem.CreateKey(object_store._namespace, k)))
16 for k in keys) 15 for k in keys)
17 16
18 def Get(self): 17 def Get(self):
(...skipping 22 matching lines...) Expand all
41 40
42 def DelMulti(self, keys): 41 def DelMulti(self, keys):
43 futures = [] 42 futures = []
44 for key in keys: 43 for key in keys:
45 futures.append(db.delete_async( 44 futures.append(db.delete_async(
46 PersistentObjectStoreItem.CreateKey(self._namespace, key))) 45 PersistentObjectStoreItem.CreateKey(self._namespace, key)))
47 # If running the dev server, the futures don't complete until the server is 46 # If running the dev server, the futures don't complete until the server is
48 # *quitting*. This is annoying. Flush now. 47 # *quitting*. This is annoying. Flush now.
49 if IsDevServer(): 48 if IsDevServer():
50 [future.wait() for future in futures] 49 [future.wait() for future in futures]
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/server2/path_canonicalizer.py ('k') | chrome/common/extensions/docs/server2/server_instance.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698