pychecker fixes

This commit is contained in:
Thomas Vander Stichele
2009-05-22 20:44:10 +00:00
parent b137f6a3fd
commit 41c92fcda4
11 changed files with 3 additions and 26 deletions

View File

@@ -21,11 +21,9 @@
# along with morituri. If not, see <http://www.gnu.org/licenses/>. # along with morituri. If not, see <http://www.gnu.org/licenses/>.
import os import os
import sys
import struct import struct
import zlib import zlib
import gobject
import gst import gst
from morituri.common import common, task from morituri.common import common, task

View File

@@ -21,7 +21,6 @@
# along with morituri. If not, see <http://www.gnu.org/licenses/>. # along with morituri. If not, see <http://www.gnu.org/licenses/>.
import os import os
import sys
import tempfile import tempfile
""" """

View File

@@ -1,8 +1,6 @@
# -*- Mode: Python -*- # -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4 # vi:si:et:sw=4:sts=4:ts=4
import os
def get(): def get():
return { return {
'isinstalled': True, 'isinstalled': True,

View File

@@ -111,7 +111,7 @@ class CueFile(object, log.Loggable):
state = 'TRACK' state = 'TRACK'
trackNumber = int(m.group('track')) trackNumber = int(m.group('track'))
trackMode = m.group('mode') #trackMode = m.group('mode')
self.debug('found track %d', trackNumber) self.debug('found track %d', trackNumber)
currentTrack = table.Track(trackNumber) currentTrack = table.Track(trackNumber)

View File

@@ -24,7 +24,6 @@
Wrap on-disk CD images based on the .cue file. Wrap on-disk CD images based on the .cue file.
""" """
import os
import struct import struct
import gst import gst
@@ -234,7 +233,7 @@ class AccurateRipResponse(object):
self.checksums = [] self.checksums = []
pos = 13 pos = 13
for i in range(self.trackCount): for _ in range(self.trackCount):
confidence = struct.unpack("B", data[pos])[0] confidence = struct.unpack("B", data[pos])[0]
checksum = "%08x" % struct.unpack("<L", data[pos + 1:pos + 5])[0] checksum = "%08x" % struct.unpack("<L", data[pos + 1:pos + 5])[0]
pos += 9 pos += 9

View File

@@ -24,11 +24,6 @@
Wrap Table of Contents. Wrap Table of Contents.
""" """
import os
import struct
import gst
from morituri.common import task, common, log from morituri.common import task, common, log
# FIXME: taken from libcdio, but no reference found for these # FIXME: taken from libcdio, but no reference found for these
@@ -166,7 +161,6 @@ class Table(object, log.Loggable):
@returns: the length of the given track number, in CD frames @returns: the length of the given track number, in CD frames
@rtype: int @rtype: int
""" """
track = self.tracks[number - 1]
return self.getTrackEnd(number) - self.getTrackStart(number) + 1 return self.getTrackEnd(number) - self.getTrackStart(number) + 1
def getAudioTracks(self): def getAudioTracks(self):
@@ -362,7 +356,6 @@ class Table(object, log.Loggable):
# add the first FILE line # add the first FILE line
path = self.tracks[0].getFirstIndex().path path = self.tracks[0].getFirstIndex().path
counter = self.tracks[0].getFirstIndex().counter counter = self.tracks[0].getFirstIndex().counter
currentPath = path
lines.append('FILE "%s" WAVE' % path) lines.append('FILE "%s" WAVE' % path)
for i, track in enumerate(self.tracks): for i, track in enumerate(self.tracks):
@@ -407,8 +400,6 @@ class Table(object, log.Loggable):
t = self.tracks[0].number t = self.tracks[0].number
index = self.tracks[0].getFirstIndex() index = self.tracks[0].getFirstIndex()
i = index.number i = index.number
# the first cut is the deepest
counter = index.counter
self.debug('clearing path') self.debug('clearing path')
while True: while True:

View File

@@ -63,7 +63,7 @@ class ProgressParser(object):
""" """
m = _PROGRESS_RE.search(line) m = _PROGRESS_RE.search(line)
if m: if m:
code = int(m.group('code')) # code = int(m.group('code'))
function = m.group('function') function = m.group('function')
offset = int(m.group('offset')) offset = int(m.group('offset'))
if function == 'read': if function == 'read':

View File

@@ -2,7 +2,6 @@
# vi:si:et:sw=4:sts=4:ts=4 # vi:si:et:sw=4:sts=4:ts=4
import os import os
import stat
import tempfile import tempfile
import unittest import unittest

View File

@@ -61,7 +61,6 @@ class TrackSeparateTestCase(unittest.TestCase):
self.assertEquals(h(checksumtask.checksums[3]), '0x7271db39') self.assertEquals(h(checksumtask.checksums[3]), '0x7271db39')
def testLength(self): def testLength(self):
tracks = self.image.cue.table.tracks
self.assertEquals(self.image.table.getTrackLength(1), 10) self.assertEquals(self.image.table.getTrackLength(1), 10)
self.assertEquals(self.image.table.getTrackLength(2), 10) self.assertEquals(self.image.table.getTrackLength(2), 10)
self.assertEquals(self.image.table.getTrackLength(3), 10) self.assertEquals(self.image.table.getTrackLength(3), 10)

View File

@@ -1,7 +1,6 @@
# -*- Mode: Python; test-case-name: morituri.test.test_image_table -*- # -*- Mode: Python; test-case-name: morituri.test.test_image_table -*-
# vi:si:et:sw=4:sts=4:ts=4 # vi:si:et:sw=4:sts=4:ts=4
import os
import unittest import unittest
from morituri.image import table from morituri.image import table

View File

@@ -54,11 +54,6 @@ class CureTestCase(unittest.TestCase):
self._assertAbsolute(2, 1, 28324) self._assertAbsolute(2, 1, 28324)
self._assertPath(1, 1, "data.wav") self._assertPath(1, 1, "data.wav")
def dump():
for t in self.toc.table.tracks:
print t
print t.indexes.values()
self.toc.table.absolutize() self.toc.table.absolutize()
self.toc.table.clearFiles() self.toc.table.clearFiles()