* Makefile.am:

* misc/pycheckerrc:
	* morituri/common/accurip.py:
	* morituri/common/checksum.py:
	* morituri/common/encode.py:
	* morituri/image/table.py:
	* morituri/rip/drive.py:
	  Fix up for pychecker warnings for 2.6
	  Fix rip drive list, which forgot some modules.
This commit is contained in:
Thomas Vander Stichele
2009-06-20 10:57:12 +00:00
parent efdc830893
commit 1643d1ec50
8 changed files with 37 additions and 14 deletions

View File

@@ -1,3 +1,15 @@
2009-06-20 Thomas Vander Stichele <thomas at apestaart dot org>
* Makefile.am:
* misc/pycheckerrc:
* morituri/common/accurip.py:
* morituri/common/checksum.py:
* morituri/common/encode.py:
* morituri/image/table.py:
* morituri/rip/drive.py:
Fix up for pychecker warnings for 2.6
Fix rip drive list, which forgot some modules.
2009-06-16 Thomas Vander Stichele <thomas at apestaart dot org>
* morituri/rip/main.py:

View File

@@ -26,7 +26,8 @@ PYCHECKER_WHITELIST = \
morituri/*/*.py
PYCHECKER_BLACKLIST = \
morituri/extern/asyncsub.py
morituri/extern/asyncsub.py \
morituri/extern/log/log.py
release: dist
make $(PACKAGE)-$(VERSION).tar.bz2.md5

View File

@@ -181,6 +181,8 @@ blacklist = [
'_interface_coptimizations',
#warning: couldn't find real module for class xml.parsers.expat.ExpatError (module name: xml.parsers.expat)
'xml.parsers.expat',
'unittest',
'morituri.extern.log.log',
]
# ignore global variables not used if name is one of these values
@@ -237,4 +239,6 @@ suppressions = {
'twisted.internet.threads.deferToThread' : "no-shadow",
# FIXME: doing this inline doesn't seem to work
'flumotion.component.producers.looper.admin_gtk.py': 'no-classattr',
# Catching a non-Exception object (KeyboardInterrupt)
'unittest': 'no-badexcept',
}

View File

@@ -93,10 +93,10 @@ def getAccurateRipResponses(data):
while data:
trackCount = struct.unpack("B", data[0])[0]
bytes = 1 + 12 + trackCount * (1 + 8)
nbytes = 1 + 12 + trackCount * (1 + 8)
ret.append(AccurateRipResponse(data[:bytes]))
data = data[bytes:]
ret.append(AccurateRipResponse(data[:nbytes]))
data = data[nbytes:]
return ret

View File

@@ -82,9 +82,9 @@ class ChecksumTask(task.Task):
if self._frameLength < 0:
self.debug('query duration')
length, format = sink.query_duration(gst.FORMAT_DEFAULT)
length, qformat = sink.query_duration(gst.FORMAT_DEFAULT)
# wavparse 0.10.14 returns in bytes
if format == gst.FORMAT_BYTES:
if qformat == gst.FORMAT_BYTES:
self.debug('query returned in BYTES format')
length /= 4
self.debug('total length: %r', length)
@@ -301,7 +301,7 @@ class TRMTask(task.Task):
gst.debug('query duration')
sink = self._pipeline.get_by_name('sink')
self._length, format = self._pipeline.query_duration(gst.FORMAT_TIME)
self._length, qformat = self._pipeline.query_duration(gst.FORMAT_TIME)
gst.debug('total length: %r' % self._length)
gst.debug('scheduling setting to play')
# since set_state returns non-False, adding it as timeout_add

View File

@@ -138,9 +138,9 @@ class EncodeTask(task.Task):
# get length
self.debug('query duration')
length, format = muxer.query_duration(gst.FORMAT_DEFAULT)
length, qformat = muxer.query_duration(gst.FORMAT_DEFAULT)
# wavparse 0.10.14 returns in bytes
if format == gst.FORMAT_BYTES:
if qformat == gst.FORMAT_BYTES:
self.debug('query returned in BYTES format')
length /= 4
self.debug('total length: %r', length)

View File

@@ -184,10 +184,10 @@ class Table(object, log.Loggable):
end = self.tracks[number].getIndex(1).absolute - 1
# if on a session border, subtract the session leadin
this = self.tracks[number - 1]
next = self.tracks[number]
if next.session > this.session:
gap = self._getSessionGap(next.session)
thisTrack = self.tracks[number - 1]
nextTrack = self.tracks[number]
if nextTrack.session > thisTrack.session:
gap = self._getSessionGap(nextTrack.session)
end -= gap
return end

View File

@@ -22,7 +22,7 @@
import os
from morituri.common import logcommand
from morituri.common import logcommand, drive
class List(logcommand.LogCommand):
summary = "list drives"
@@ -37,6 +37,12 @@ class List(logcommand.LogCommand):
return
try:
import cdio
except ImportError:
print 'Install pycdio for vendora/model/release detection.'
return
for path in paths:
device = cdio.Device(path)
ok, vendor, model, release = device.get_hwinfo()