[SCM] morituri/master: make sources an object property

js at users.alioth.debian.org js at users.alioth.debian.org
Sun Oct 19 20:10:12 UTC 2014


The following commit has been merged in the master branch:
commit b59bf8f98a2b68c2349fd939c4e7965eda2de32a
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date:   Tue Aug 20 00:10:02 2013 +0200

    make sources an object property

diff --git a/morituri/image/toc.py b/morituri/image/toc.py
index 04ac542..52e5ade 100644
--- a/morituri/image/toc.py
+++ b/morituri/image/toc.py
@@ -142,6 +142,9 @@ class TocFile(object, log.Loggable):
         self.table = table.Table()
         self.logName = '<TocFile %08x>' % id(self)
 
+        self._sources = Sources()
+
+
     def parse(self):
         # these two objects start as None then get set as real objects,
         # so no need to complain about them here
@@ -161,8 +164,6 @@ class TocFile(object, log.Loggable):
         totalLength = 0 # accrued during TRACK record parsing, total disc
         pregapLength = 0 # length of the pre-gap, current track in for loop
 
-        sources = Sources()
-
         # the first track's INDEX 1 can only be gotten from the .toc
         # file once the first pregap is calculated; so we add INDEX 1
         # at the end of each parsed  TRACK record
@@ -248,7 +249,7 @@ class TocFile(object, log.Loggable):
             if m:
                 length = m.group('length')
                 self.debug('SILENCE of %r', length)
-                sources.append(counter, absoluteOffset, None)
+                self._sources.append(counter, absoluteOffset, None)
                 if currentFile is not None:
                     self.debug('SILENCE after FILE, increasing counter')
                     counter += 1
@@ -284,7 +285,7 @@ class TocFile(object, log.Loggable):
                         trackNumber, counter)
                 currentFile = File(filePath, common.msfToFrames(start),
                     common.msfToFrames(length))
-                sources.append(counter, absoluteOffset + currentLength,
+                self._sources.append(counter, absoluteOffset + currentLength,
                     currentFile)
                 #absoluteOffset += common.msfToFrames(start)
                 currentLength += common.msfToFrames(length)
@@ -318,10 +319,10 @@ class TocFile(object, log.Loggable):
                     continue
 
                 length = common.msfToFrames(m.group('length'))
-                c, o, s = sources.get(absoluteOffset)
+                c, o, s = self._sources.get(absoluteOffset)
                 self.debug('at abs offset %d, we are in source %r' % (
                     absoluteOffset, s))
-                counterStart = sources.getCounterStart(c)
+                counterStart = self._sources.getCounterStart(c)
                 relativeOffset = absoluteOffset - counterStart
 
                 currentTrack.index(0, path=s and s.path or None,

-- 
morituri packaging



More information about the pkg-multimedia-commits mailing list