[SCM] morituri/master: * morituri/common/task.py: Update the docs.
js at users.alioth.debian.org
js at users.alioth.debian.org
Sun Oct 19 20:08:44 UTC 2014
The following commit has been merged in the master branch:
commit 10647d18a1e052da81ddea4ad59fc503903ba925
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date: Sun Apr 12 08:34:44 2009 +0000
* morituri/common/task.py:
Update the docs.
diff --git a/ChangeLog b/ChangeLog
index f532ecb..fc66cc6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2009-04-12 Thomas Vander Stichele <thomas at apestaart dot org>
+ * morituri/common/task.py:
+ Update the docs.
+
+2009-04-12 Thomas Vander Stichele <thomas at apestaart dot org>
+
* morituri/test/test_image_image.py (added):
Add tests for AudioRip CRC'ing images.
diff --git a/morituri/common/task.py b/morituri/common/task.py
index b5b5ec6..60e515a 100644
--- a/morituri/common/task.py
+++ b/morituri/common/task.py
@@ -43,6 +43,8 @@ class Task(object):
### subclass methods
def start(self):
"""
+ Start the task.
+
Subclasses should chain up to me at the beginning.
"""
self.progress = 0.0
@@ -51,6 +53,8 @@ class Task(object):
def stop(self):
"""
+ Stop the task.
+
Subclasses should chain up to me at the end.
"""
self.debug('stopping')
@@ -64,12 +68,21 @@ class Task(object):
sys.stdout.flush()
def setProgress(self, value):
+ """
+ Notify about progress changes bigger than the increment.
+ Called by subclass implementations as the task progresses.
+ """
if value - self.progress > self.increment or value >= 1.0:
self.progress = value
self._notifyListeners('progressed', value)
self.debug('notifying progress', value)
def addListener(self, listener):
+ """
+ Add a listener for task status changes.
+
+ Listeners should implement started, stopped, and progressed.
+ """
if not self._listeners:
self._listeners = []
self._listeners.append(listener)
--
morituri packaging
More information about the pkg-multimedia-commits
mailing list