[SCM] morituri/master: * morituri/image/table.py: Extract one function to write a FILE line.

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


The following commit has been merged in the master branch:
commit 041a492f679afece621ee80dbe32fc709a52bcad
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date:   Sun May 22 17:17:33 2011 +0000

    	* morituri/image/table.py:
    	  Extract one function to write a FILE line.

diff --git a/ChangeLog b/ChangeLog
index 09f7428..aa152fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2011-05-22  Thomas Vander Stichele  <thomas at apestaart dot org>
 
+	* morituri/image/table.py:
+	  Extract one function to write a FILE line.
+
+2011-05-22  Thomas Vander Stichele  <thomas at apestaart dot org>
+
 	patch by: Ross Burton <ross at burtonini.com>
 
 	* morituri/image/table.py:
diff --git a/morituri/image/table.py b/morituri/image/table.py
index b95e6d3..9b6522b 100644
--- a/morituri/image/table.py
+++ b/morituri/image/table.py
@@ -528,6 +528,10 @@ class Table(object, log.Loggable):
         """
         lines = []
 
+        def writeFile(path):
+            lines.append('FILE "%s" WAVE' % os.path.basename(path))
+
+
         # header
         main = ['PERFORMER', 'TITLE']
 
@@ -549,7 +553,7 @@ class Table(object, log.Loggable):
         # add the first FILE line
         path = self.tracks[0].getFirstIndex().path
         counter = self.tracks[0].getFirstIndex().counter
-        lines.append('FILE "%s" WAVE' % os.path.basename(path))
+        writeFile(path)
 
         for i, track in enumerate(self.tracks):
             # FIXME: skip data tracks for now
@@ -561,7 +565,7 @@ class Table(object, log.Loggable):
             if not track.indexes.has_key(0):
                 index = track.indexes[1]
                 if index.counter != counter:
-                    lines.append('FILE "%s" WAVE' % os.path.basename(index.path))
+                    writeFile(index.path)
                     counter = index.counter
             lines.append("  TRACK %02d %s" % (i + 1, 'AUDIO'))
             for key in CDTEXT_FIELDS:
@@ -577,7 +581,7 @@ class Table(object, log.Loggable):
             for number in indexes:
                 index = track.indexes[number]
                 if index.counter != counter:
-                    lines.append('FILE "%s" WAVE' % os.path.basename(index.path))
+                    writeFile(index.path)
                     counter = index.counter
                 lines.append("    INDEX %02d %s" % (number,
                     common.framesToMSF(index.relative)))

-- 
morituri packaging



More information about the pkg-multimedia-commits mailing list