* morituri/common/task.py:

Move methods around.
This commit is contained in:
Thomas Vander Stichele
2009-04-11 16:38:41 +00:00
parent 8345938584
commit 6234b08a2f
2 changed files with 19 additions and 4 deletions

View File

@@ -1,3 +1,8 @@
2009-04-11 Thomas Vander Stichele <thomas at apestaart dot org>
* morituri/common/task.py:
Move methods around.
2009-04-11 Thomas Vander Stichele <thomas at apestaart dot org>
* examples/ARcue.py:

View File

@@ -39,20 +39,30 @@ class Task(object):
_listeners = None
def debug(self, *args, **kwargs):
return
print args, kwargs
sys.stdout.flush()
### subclass methods
def start(self):
"""
Subclasses should chain up to me at the beginning.
"""
self.progress = 0.0
self.running = True
self._notifyListeners('started')
def stop(self):
"""
Subclasses should chain up to me at the end.
"""
self.debug('stopping')
self.running = False
self._notifyListeners('stopped')
### base class methods
def debug(self, *args, **kwargs):
return
print self, args, kwargs
sys.stdout.flush()
def setProgress(self, value):
if value - self.progress > self.increment or value >= 1.0:
self.progress = value