[Neo-report] r2714 jm - /trunk/neo/client/Storage.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Apr 12 20:46:08 CEST 2011


Author: jm
Date: Tue Apr 12 20:46:07 2011
New Revision: 2714

Log:
client: fix _cache attribute of Storage

Modified:
    trunk/neo/client/Storage.py

Modified: trunk/neo/client/Storage.py
==============================================================================
--- trunk/neo/client/Storage.py [iso-8859-1] (original)
+++ trunk/neo/client/Storage.py [iso-8859-1] Tue Apr 12 20:46:07 2011
@@ -35,13 +35,6 @@ def check_read_only(func):
         return func(self, *args, **kw)
     return wraps(func)(wrapped)
 
-class DummyCache(object):
-    def __init__(self, app):
-        self.app = app
-
-    def clear(self):
-        self.app.mq_cache.clear()
-
 class Storage(BaseStorage.BaseStorage,
               ConflictResolution.ConflictResolvingStorage):
     """Wrapper class for neoclient."""
@@ -64,9 +57,7 @@ class Storage(BaseStorage.BaseStorage,
     )))
 
     def __init__(self, master_nodes, name, connector=None, read_only=False,
-            compress=None, logfile=None, verbose=False,
-            _app=None, _cache=None,
-            **kw):
+            compress=None, logfile=None, verbose=False, _app=None, **kw):
         """
         Do not pass those parameters (used internally):
         _app
@@ -81,11 +72,7 @@ class Storage(BaseStorage.BaseStorage,
         if _app is None:
             _app = Application(master_nodes, name, connector,
                 compress=compress)
-            assert _cache is None
-            _cache = DummyCache(_app)
         self.app = _app
-        assert _cache is not None
-        self._cache = _cache
         # Used to clone self (see new_instance & IMVCCStorage definition).
         self._init_args = (master_nodes, name)
         self._init_kw = {
@@ -95,9 +82,12 @@ class Storage(BaseStorage.BaseStorage,
             'logfile': logfile,
             'verbose': verbose,
             '_app': _app,
-            '_cache': _cache,
         }
 
+    @property
+    def _cache(self):
+        return self.app._cache
+
     def _getSnapshotTID(self):
         """
         Get the highest TID visible for current transaction.




More information about the Neo-report mailing list