[SCM] morituri/master: * morituri/common/task.py: * morituri/image/cue.py: Add logCategory. * morituri/image/image.py: If subtasks had an exception, retrigger the exception and stop.

js at users.alioth.debian.org js at users.alioth.debian.org
Sun Oct 19 20:09:16 UTC 2014


The following commit has been merged in the master branch:
commit f978907fcfa74c1b354dca6c1379ca32a4c86450
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date:   Mon Apr 5 23:31:34 2010 +0000

    	* morituri/common/task.py:
    	* morituri/image/cue.py:
    	  Add logCategory.
    	* morituri/image/image.py:
    	  If subtasks had an exception, retrigger the exception and stop.

diff --git a/ChangeLog b/ChangeLog
index e7a6883..bb1e80e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 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:
 	  Fix AudioLengthTask for the case where we don't have the decoder,
 	  by instead of doing get_state, waiting for an ASYNC_DONE or ERROR
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

-- 
morituri packaging



More information about the pkg-multimedia-commits mailing list