[SCM] morituri/master: * morituri/test/kanye.cue (added): Add a cue test with mixed mode. * morituri/image/cue.py: * morituri/test/test_image_cue.py: Handle it properly.

js at users.alioth.debian.org js at users.alioth.debian.org
Sun Oct 19 20:08:49 UTC 2014


The following commit has been merged in the master branch:
commit c4f22acda571ba3e3755239b2f86c372d333a0f9
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date:   Sun Apr 26 11:19:03 2009 +0000

    	* morituri/test/kanye.cue (added):
    	  Add a cue test with mixed mode.
    	* morituri/image/cue.py:
    	* morituri/test/test_image_cue.py:
    	  Handle it properly.

diff --git a/ChangeLog b/ChangeLog
index 1cd3d32..a98459d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-04-26  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* morituri/test/kanye.cue (added):
+	  Add a cue test with mixed mode.
+	* morituri/image/cue.py:
+	* morituri/test/test_image_cue.py:
+	  Handle it properly.
+
 2009-04-25  Thomas Vander Stichele  <thomas at apestaart dot org>
 
 	* morituri/image/cue.py:
diff --git a/morituri/image/cue.py b/morituri/image/cue.py
index b562975..c4162d8 100644
--- a/morituri/image/cue.py
+++ b/morituri/image/cue.py
@@ -42,7 +42,7 @@ _FILE_RE = re.compile(r"""
 _TRACK_RE = re.compile(r"""
     ^\s+TRACK            # TRACK
     \s+(?P<track>\d\d)   # two-digit track number
-    \s+(?P<mode>\w+)$    # mode (AUDIO/...)
+    \s+(?P<mode>.+)$    # mode (AUDIO, MODEx/2xxx, ...)
 """, re.VERBOSE)
 
 _INDEX_RE = re.compile(r"""
@@ -224,7 +224,8 @@ class Track:
         @type file: L{File}
         """
         if number in self._indexes.keys():
-            raise KeyError, "index %d already in track" % number
+            raise KeyError, "index %d already in track %d" % (
+                number, self.number)
         if number < 0 or number > 99:
             raise IndexError, "Index number must be from 0 to 99"
 
diff --git a/morituri/test/kanye.cue b/morituri/test/kanye.cue
new file mode 100644
index 0000000..0800ac0
--- /dev/null
+++ b/morituri/test/kanye.cue
@@ -0,0 +1,88 @@
+REM GENRE "Hip Hop"
+REM DATE 2008
+REM DISCID A90D2E0D
+REM COMMENT "ExactAudioCopy v0.99pb4"
+CATALOG 0602517931596
+PERFORMER "Kanye West"
+TITLE "808s & Heartbreak"
+FILE "Kanye West - 808s & Heartbreak\Kanye West - Say You Will.wav" WAVE
+  TRACK 01 AUDIO
+    TITLE "Say You Will"
+    PERFORMER "Kanye West"
+    ISRC USUM70846386
+    INDEX 01 00:00:00
+FILE "Kanye West - 808s & Heartbreak\Kanye West - Welcome To Heartbreak (Feat. Kid Cudi).wav" WAVE
+  TRACK 02 AUDIO
+    TITLE "Welcome To Heartbreak (Feat. Kid Cudi)"
+    PERFORMER "Kanye West"
+    ISRC USUM70846387
+    INDEX 01 00:00:00
+  TRACK 03 AUDIO
+    TITLE "Heartless"
+    PERFORMER "Kanye West"
+    ISRC USUM70840511
+    INDEX 00 04:22:70
+FILE "Kanye West - 808s & Heartbreak\Kanye West - Heartless.wav" WAVE
+    INDEX 01 00:00:00
+FILE "Kanye West - 808s & Heartbreak\Kanye West - Amazing (Feat. Young Jeezy).wav" WAVE
+  TRACK 04 AUDIO
+    TITLE "Amazing (Feat. Young Jeezy)"
+    PERFORMER "Kanye West"
+    ISRC USUM70846401
+    INDEX 01 00:00:00
+FILE "Kanye West - 808s & Heartbreak\Kanye West - Love Lockdown.wav" WAVE
+  TRACK 05 AUDIO
+    TITLE "Love Lockdown"
+    PERFORMER "Kanye West"
+    ISRC USUM70837229
+    INDEX 01 00:00:00
+  TRACK 06 AUDIO
+    TITLE "Paranoid (Feat. Mr. Hudson)"
+    PERFORMER "Kanye West"
+    ISRC USUM70846402
+    INDEX 00 04:30:23
+FILE "Kanye West - 808s & Heartbreak\Kanye West - Paranoid (Feat. Mr. Hudson).wav" WAVE
+    INDEX 01 00:00:00
+FILE "Kanye West - 808s & Heartbreak\Kanye West - RoboCop.wav" WAVE
+  TRACK 07 AUDIO
+    TITLE "RoboCop"
+    PERFORMER "Kanye West"
+    ISRC USUM70846388
+    INDEX 01 00:00:00
+  TRACK 08 AUDIO
+    TITLE "Street Lights"
+    PERFORMER "Kanye West"
+    ISRC USUM70846403
+    INDEX 00 04:34:27
+FILE "Kanye West - 808s & Heartbreak\Kanye West - Street Lights.wav" WAVE
+    INDEX 01 00:00:00
+FILE "Kanye West - 808s & Heartbreak\Kanye West - Bad News.wav" WAVE
+  TRACK 09 AUDIO
+    TITLE "Bad News"
+    PERFORMER "Kanye West"
+    ISRC USUM70846389
+    INDEX 01 00:00:00
+FILE "Kanye West - 808s & Heartbreak\Kanye West - See You In My Nightmares (Feat. Lil Wayne).wav" WAVE
+  TRACK 10 AUDIO
+    TITLE "See You In My Nightmares (Feat. Lil Wayne)"
+    PERFORMER "Kanye West"
+    ISRC USUM70846390
+    INDEX 01 00:00:00
+  TRACK 11 AUDIO
+    TITLE "Coldest Winter"
+    PERFORMER "Kanye West"
+    ISRC USUM70846400
+    INDEX 00 04:18:09
+FILE "Kanye West - 808s & Heartbreak\Kanye West - Coldest Winter.wav" WAVE
+    INDEX 01 00:00:00
+  TRACK 12 AUDIO
+    TITLE "Pinocchio Story (Freestyle Live From Singapore)"
+    PERFORMER "Kanye West"
+    ISRC USUM70846838
+    INDEX 00 02:44:25
+FILE "Kanye West - 808s & Heartbreak\Kanye West - Pinocchio Story (Freestyle Live From Singapore).wav" WAVE
+    INDEX 01 00:00:00
+  TRACK 13 MODEx/2xxx
+    TITLE "Data Track"
+    PERFORMER "Kanye West"
+    INDEX 00 06:01:45
diff --git a/morituri/test/test_image_cue.py b/morituri/test/test_image_cue.py
index 9c0d34f..d05553f 100644
--- a/morituri/test/test_image_cue.py
+++ b/morituri/test/test_image_cue.py
@@ -33,3 +33,14 @@ class KingsSeparateTestCase(unittest.TestCase):
         self.assertEquals(self.cue.getTrackLength(t), -1)
         t = self.cue.tracks[-1]
         self.assertEquals(self.cue.getTrackLength(t), -1)
+
+class KanyeMixedTestCase(unittest.TestCase):
+    def setUp(self):
+        self.cue = cue.Cue(os.path.join(os.path.dirname(__file__),
+            'kanye.cue'))
+        self.cue.parse()
+        self.assertEquals(len(self.cue.tracks), 13)
+
+    def testGetTrackLength(self):
+        t = self.cue.tracks[0]
+        self.assertEquals(self.cue.getTrackLength(t), -1)

-- 
morituri packaging



More information about the pkg-multimedia-commits mailing list