OLD | NEW |
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 cache_chain_object_store import CacheChainObjectStore | 5 from cache_chain_object_store import CacheChainObjectStore |
6 from environment import GetAppVersion | 6 from environment import GetAppVersion |
| 7 from environment_wrappers import CreatePersistentObjectStore |
7 from memcache_object_store import MemcacheObjectStore | 8 from memcache_object_store import MemcacheObjectStore |
8 from test_object_store import TestObjectStore | 9 from test_object_store import TestObjectStore |
9 from persistent_object_store import PersistentObjectStore | |
10 | 10 |
11 _unspecified = object() | 11 _unspecified = object() |
12 | 12 |
13 class ObjectStoreCreator(object): | 13 class ObjectStoreCreator(object): |
14 '''Creates ObjectStores with a namespacing and behaviour configuration. | 14 '''Creates ObjectStores with a namespacing and behaviour configuration. |
15 | 15 |
16 The initial configuration is specified on object store construction. When | 16 The initial configuration is specified on object store construction. When |
17 creating ObjectStores via Create this configuration can be overridden (or | 17 creating ObjectStores via Create this configuration can be overridden (or |
18 via the variants of Create which do this automatically). | 18 via the variants of Create which do this automatically). |
19 ''' | 19 ''' |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 ('category', category), | 69 ('category', category), |
70 ('app_version', app_version)) | 70 ('app_version', app_version)) |
71 if value is not None) | 71 if value is not None) |
72 | 72 |
73 if self._disable_wrappers: | 73 if self._disable_wrappers: |
74 return self._store_type(namespace, start_empty=start_empty) | 74 return self._store_type(namespace, start_empty=start_empty) |
75 | 75 |
76 if self._store_type is not None: | 76 if self._store_type is not None: |
77 chain = (self._store_type(namespace),) | 77 chain = (self._store_type(namespace),) |
78 else: | 78 else: |
79 chain = (MemcacheObjectStore(namespace), PersistentObjectStore(namespace)) | 79 chain = (MemcacheObjectStore(namespace), |
| 80 CreatePersistentObjectStore(namespace)) |
80 return CacheChainObjectStore(chain, start_empty=start_empty) | 81 return CacheChainObjectStore(chain, start_empty=start_empty) |
OLD | NEW |