* morituri/common/task.py:
Make task subclass log.Log
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2009-05-01 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* morituri/common/task.py:
|
||||
Make task subclass log.Log
|
||||
|
||||
2009-05-01 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* morituri/common/log.py:
|
||||
|
||||
@@ -25,7 +25,9 @@ import sys
|
||||
import gobject
|
||||
import gtk
|
||||
|
||||
class Task(object):
|
||||
from morituri.common import log
|
||||
|
||||
class Task(object, log.Loggable):
|
||||
"""
|
||||
I wrap a task in an asynchronous interface.
|
||||
I can be listened to for starting, stopping, and progress updates.
|
||||
@@ -66,11 +68,6 @@ class Task(object):
|
||||
self._notifyListeners('stopped')
|
||||
|
||||
### base class methods
|
||||
def debug(self, *args, **kwargs):
|
||||
return
|
||||
print self, args, kwargs
|
||||
sys.stdout.flush()
|
||||
|
||||
def setProgress(self, value):
|
||||
"""
|
||||
Notify about progress changes bigger than the increment.
|
||||
@@ -79,7 +76,7 @@ class Task(object):
|
||||
if value - self.progress > self.increment or value >= 1.0 or value == 0.0:
|
||||
self.progress = value
|
||||
self._notifyListeners('progressed', value)
|
||||
self.debug('notifying progress', value)
|
||||
self.debug('notifying progress: %r', value)
|
||||
|
||||
def setDescription(self, description):
|
||||
if description != self.description:
|
||||
|
||||
Reference in New Issue
Block a user