diff --git a/ChangeLog b/ChangeLog index e7a6883..bb1e80e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-04-06 Thomas Vander Stichele + + * 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 * morituri/image/image.py: diff --git a/morituri/common/task.py b/morituri/common/task.py index e9e3d4c..2d8f377 100644 --- a/morituri/common/task.py +++ b/morituri/common/task.py @@ -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 diff --git a/morituri/image/cue.py b/morituri/image/cue.py index a88fafa..dd1e9f2 100644 --- a/morituri/image/cue.py +++ b/morituri/image/cue.py @@ -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 diff --git a/morituri/image/image.py b/morituri/image/image.py index e5237b8..8076f29 100644 --- a/morituri/image/image.py +++ b/morituri/image/image.py @@ -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