1 class Task(GObject):
 2     def execute(self):
 3         """
 4         Performs the actual task.  Subclasses may override this
 5         method or simply set the task delegate and it will be
 6         executed for you.
 7         """
 8     def cancel(self):
 9         """
10         Cancels the task.  It is up to the execute() method to
11         check the state to see if it has been cancelled.
12         """
13     def add_callback(self, callback, *args):
14         """
15         Adds a new handler to the post-processing chain.  The handler
16         is a callback type which means the task or previous handler
17         must have returned cleanly for the callback to be called.
18
19         callback is called with the extra arguments passed.
20         """
21     def add_errback(self, errback, *args):
22         """
23         Adds a new handler to the post-processing chain.  The handler
24         is a errback type which means the task, previous callback, or
25         previous errback must have returned uncleanly, leaving an error
26         for the current state of the task.
27
28         See also: g_task_set_error().
29         """
30     def add_dependency(self, task):
31         """
32         Adds a task as a dependency for the task's execution.  This
33         means that the task will continue to be in the G_TASK_WAITING
34         state until the dependent tasks have completed.
35         """
36     def remove_dependency(self, task):
37         """
38         Removes a task from being a dependency for the task.  If
39         no more dependencies exist and the task has previously been
40         scheduled, it will be executed.
41         """