* morituri/common/task.py:

* morituri/image/cue.py:
	  Add logCategory.
	* morituri/image/image.py:
	  If subtasks had an exception, retrigger the exception and stop.
This commit is contained in:
Thomas Vander Stichele
2010-04-05 23:31:34 +00:00
parent 8ea1dc025d
commit f978907fcf
4 changed files with 22 additions and 0 deletions

View File

@@ -1,3 +1,11 @@
2010-04-06 Thomas Vander Stichele <thomas at apestaart dot org>
* morituri/common/task.py:
* morituri/image/cue.py:
Add logCategory.
* morituri/image/image.py:
If subtasks had an exception, retrigger the exception and stop.
2010-04-06 Thomas Vander Stichele <thomas at apestaart dot org>
* morituri/image/image.py:

View File

@@ -52,6 +52,8 @@ class Task(object, log.Loggable):
@ivar exception: set if an exception happened during the task
execution. Will be raised through run() at the end.
"""
logCategory = 'Task'
description = 'I am doing something.'
progress = 0.0

View File

@@ -65,6 +65,8 @@ class CueFile(object, log.Loggable):
@type table: L{table.Table}
@ivar table: the index table.
"""
logCategory = 'CueFile'
def __init__(self, path):
"""
@type path: unicode

View File

@@ -34,6 +34,7 @@ class Image(object, log.Loggable):
@ivar table: The Table of Contents for this image.
@type table: L{table.Table}
"""
logCategory = 'Image'
def __init__(self, path):
"""
@@ -138,6 +139,7 @@ class AudioLengthTask(task.Task):
@ivar length: length of the decoded audio file, in audio frames.
"""
logCategory = 'AudioLengthTask'
description = 'Getting length of audio track'
length = None
@@ -211,6 +213,8 @@ class ImageVerifyTask(task.MultiSeparateTask):
I verify a disk image and get the necessary track lengths.
"""
logCategory = 'ImageVerifyTask'
description = "Checking tracks"
lengths = None
@@ -239,6 +243,12 @@ class ImageVerifyTask(task.MultiSeparateTask):
def stop(self):
for trackIndex, track, taskk in self._tasks:
if taskk.exception:
self.debug('subtask %r had exception %r, shutting down' % (
taskk, taskk.exception))
self.setException(taskk.exception)
break
# print '%d has length %d' % (trackIndex, taskk.length)
index = track.indexes[1]
assert taskk.length % common.SAMPLES_PER_FRAME == 0