[open-ils-commits] r759 - constrictor/trunk/constrictor (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Jan 15 15:04:43 EST 2010


Author: erickson
Date: 2010-01-15 15:04:39 -0500 (Fri, 15 Jan 2010)
New Revision: 759

Modified:
   constrictor/trunk/constrictor/task.py
Log:
it's now possible to run a single task more than once inside a given script.  No need to instantiate each task before calling start()

Modified: constrictor/trunk/constrictor/task.py
===================================================================
--- constrictor/trunk/constrictor/task.py	2010-01-15 19:49:37 UTC (rev 758)
+++ constrictor/trunk/constrictor/task.py	2010-01-15 20:04:39 UTC (rev 759)
@@ -30,6 +30,9 @@
 
     def __init__(self, name=''):
         self.name = name
+        self.reset()
+
+    def reset(self):
         self.duration = 0
         self.success = False
         self.complete = False
@@ -40,6 +43,7 @@
 
     def start(self, **kwargs):
 
+        self.reset()
         ret = None # capture the return value from the task
         start = time.time()
 



More information about the open-ils-commits mailing list