[Neo-report] r2487 vincent - /trunk/neo/client/app.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Dec 9 13:54:43 CET 2010


Author: vincent
Date: Thu Dec  9 13:54:43 2010
New Revision: 2487

Log:
Split _load for future extensions.

Modified:
    trunk/neo/client/app.py

Modified: trunk/neo/client/app.py
==============================================================================
--- trunk/neo/client/app.py [iso-8859-1] (original)
+++ trunk/neo/client/app.py [iso-8859-1] Thu Dec  9 13:54:43 2010
@@ -499,6 +499,20 @@ class Application(object):
         if not self.local_var.barrier_done:
             self.invalidationBarrier()
             self.local_var.barrier_done = True
+        data, start_serial, end_serial = self._loadFromStorage(oid, serial,
+            tid)
+        if cache:
+            self._cache_lock_acquire()
+            try:
+                self.mq_cache[oid] = start_serial, data
+            finally:
+                self._cache_lock_release()
+        if data == '':
+            raise NEOStorageCreationUndoneError(dump(oid))
+        return data, start_serial, end_serial
+
+    @profiler_decorator
+    def _loadFromStorage(self, oid, serial, tid):
         cell_list = self._getCellListForOID(oid, readable=True)
         if len(cell_list) == 0:
             # No cells available, so why are we running ?
@@ -551,16 +565,6 @@ class Application(object):
         # Uncompress data
         if compression:
             data = decompress(data)
-
-        # Put in cache only when using load
-        if cache:
-            self._cache_lock_acquire()
-            try:
-                self.mq_cache[oid] = start_serial, data
-            finally:
-                self._cache_lock_release()
-        if data == '':
-            raise NEOStorageCreationUndoneError(dump(oid))
         return data, start_serial, end_serial
 
 




More information about the Neo-report mailing list