[Erp5-report] r7291 - in /erp5/trunk/products/CMFActivity: ActivityBuffer.py ActivityTool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue May 16 15:51:40 CEST 2006


Author: alex
Date: Tue May 16 15:51:37 2006
New Revision: 7291

URL: http://svn.erp5.org?rev=7291&view=rev
Log:
Fixes "ActivityBuffer instance has no attribute '_activity_tool'" when
restarting the site with only failed activities in the queue (#253).

Modified:
    erp5/trunk/products/CMFActivity/ActivityBuffer.py
    erp5/trunk/products/CMFActivity/ActivityTool.py

Modified: erp5/trunk/products/CMFActivity/ActivityBuffer.py
URL: http://svn.erp5.org/erp5/trunk/products/CMFActivity/ActivityBuffer.py?rev=7291&r1=7290&r2=7291&view=diff
==============================================================================
--- erp5/trunk/products/CMFActivity/ActivityBuffer.py (original)
+++ erp5/trunk/products/CMFActivity/ActivityBuffer.py Tue May 16 15:51:37 2006
@@ -36,13 +36,15 @@
 
     _p_oid=_p_changed=_registered=None
 
-    def __init__(self):
+    def __init__(self, activity_tool=None):
         from thread import allocate_lock
         self._use_TM = self._transactions = 1
         if self._use_TM:
             self._tlock = allocate_lock()
             self._tthread = None
         self._lock = allocate_lock()
+        if activity_tool is not None:
+          self._activity_tool = activity_tool
 
     # Keeps a list of messages to add and remove
     # at end of transaction

Modified: erp5/trunk/products/CMFActivity/ActivityTool.py
URL: http://svn.erp5.org/erp5/trunk/products/CMFActivity/ActivityTool.py?rev=7291&r1=7290&r2=7291&view=diff
==============================================================================
--- erp5/trunk/products/CMFActivity/ActivityTool.py (original)
+++ erp5/trunk/products/CMFActivity/ActivityTool.py Tue May 16 15:51:37 2006
@@ -609,7 +609,7 @@
       global is_initialized
       if not is_initialized: self.initialize()
       if getattr(self, '_v_activity_buffer', None) is None:
-        self._v_activity_buffer = ActivityBuffer()
+        self._v_activity_buffer = ActivityBuffer(activity_tool=self)
       return ActiveWrapper(object, activity, active_process, **kw)
 
     def deferredQueueMessage(self, activity, message):
@@ -617,7 +617,7 @@
 
     def deferredDeleteMessage(self, activity, message):
       if getattr(self, '_v_activity_buffer', None) is None:
-        self._v_activity_buffer = ActivityBuffer()
+        self._v_activity_buffer = ActivityBuffer(activity_tool=self)
       self._v_activity_buffer.deferredDeleteMessage(self, activity, message)
 
     def getRegisteredMessageList(self, activity):
@@ -636,7 +636,7 @@
       global is_initialized
       if not is_initialized: self.initialize()
       if getattr(self, '_v_activity_buffer', None) is None:
-        self._v_activity_buffer = ActivityBuffer()
+        self._v_activity_buffer = ActivityBuffer(activity_tool=self)
       if type(object) is TupleType:
         object_path = object
       else:
@@ -763,7 +763,7 @@
       global is_initialized
       if not is_initialized: self.initialize()
       if getattr(self, '_v_activity_buffer', None) is None:
-        self._v_activity_buffer = ActivityBuffer()
+        self._v_activity_buffer = ActivityBuffer(activity_tool=self)
       activity_dict[activity].queueMessage(self,
         Message(path, active_process, activity_kw, method_id, args, kw))
 




More information about the Erp5-report mailing list