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

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

Issue 14218004: Devserver: only populate data during cron jobs, meaning all data from instances (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: PTAL Created 7 years, 8 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 | Annotate | Revision Log
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 in_memory_object_store import InMemoryObjectStore 5 from cache_chain_object_store import CacheChainObjectStore
6 from memcache_object_store import MemcacheObjectStore 6 from memcache_object_store import MemcacheObjectStore
7 from persistent_object_store import PersistentObjectStore
7 8
8 class ObjectStoreCreator(object): 9 class ObjectStoreCreator(object):
9 class Factory(object): 10 class Factory(object):
10 def __init__(self, branch=None): 11 def __init__(self, branch=None):
11 self._branch = branch 12 self._branch = branch
12 13
13 '''Creates ObjectStoreCreators (yes seriously) bound to an SVN branch. 14 '''Creates ObjectStoreCreators (yes seriously) bound to an SVN branch.
14 ''' 15 '''
15 def Create(self, cls, store_type=None): 16 def Create(self, cls, store_type=None):
16 return ObjectStoreCreator(cls, branch=self._branch, store_type=store_type) 17 return ObjectStoreCreator(cls, branch=self._branch, store_type=store_type)
(...skipping 21 matching lines...) Expand all
38 ''' 39 '''
39 namespace = self._name 40 namespace = self._name
40 if category is not None: 41 if category is not None:
41 assert not any(c.isdigit() for c in category) 42 assert not any(c.isdigit() for c in category)
42 namespace = '%s/%s' % (namespace, category) 43 namespace = '%s/%s' % (namespace, category)
43 if version is not None: 44 if version is not None:
44 assert isinstance(version, int) 45 assert isinstance(version, int)
45 namespace = '%s/%s' % (namespace, version) 46 namespace = '%s/%s' % (namespace, version)
46 if self._store_type is not None: 47 if self._store_type is not None:
47 return self._store_type(namespace) 48 return self._store_type(namespace)
48 return InMemoryObjectStore(MemcacheObjectStore(namespace)) 49 return CacheChainObjectStore((MemcacheObjectStore(namespace),
50 PersistentObjectStore(namespace)))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698