[kupfer] task: Document "Task protocol"



commit 320ec10a79aa40d5ffec984d3960c414e1b8b9c7
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Sun May 9 16:25:25 2010 +0100

    task: Document "Task protocol"

 kupfer/task.py |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/kupfer/task.py b/kupfer/task.py
index f4ffe2c..000c2dd 100644
--- a/kupfer/task.py
+++ b/kupfer/task.py
@@ -6,7 +6,17 @@ import gobject
 from kupfer import scheduler, pretty
 
 class Task (object):
-	"""Represent a task that can be done in the background"""
+	"""Represent a task that can be done in the background
+
+	The finish_callback received in Task.start(..) must be stored,
+	and regardless if the task exits with an error, or completes
+	successfully, the callback *must* be called.
+
+	The finish callback must pass the Task instance itself as
+	the only and first argument:
+
+	    finish_callback(self)
+	"""
 	def __init__(self, name=None):
 		self.name = name
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]