Review existing comments and add new ones
Also clarified a statement
This commit is contained in:
@@ -66,6 +66,7 @@ disc and track template are:
|
|||||||
class _CD(BaseCommand):
|
class _CD(BaseCommand):
|
||||||
eject = True
|
eject = True
|
||||||
|
|
||||||
|
# XXX: Pylint, parameters differ from overridden 'add_arguments' method
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def add_arguments(parser):
|
def add_arguments(parser):
|
||||||
parser.add_argument('-R', '--release-id',
|
parser.add_argument('-R', '--release-id',
|
||||||
@@ -205,6 +206,7 @@ class Info(_CD):
|
|||||||
|
|
||||||
# Requires opts.device
|
# Requires opts.device
|
||||||
|
|
||||||
|
# XXX: Pylint, parameters differ from overridden 'add_arguments' method
|
||||||
def add_arguments(self):
|
def add_arguments(self):
|
||||||
_CD.add_arguments(self.parser)
|
_CD.add_arguments(self.parser)
|
||||||
|
|
||||||
@@ -228,6 +230,7 @@ Log files will log the path to tracks relative to this directory.
|
|||||||
# Requires opts.record
|
# Requires opts.record
|
||||||
# Requires opts.device
|
# Requires opts.device
|
||||||
|
|
||||||
|
# XXX: Pylint, parameters differ from overridden 'add_arguments' method
|
||||||
def add_arguments(self):
|
def add_arguments(self):
|
||||||
loggers = list(result.getLoggers())
|
loggers = list(result.getLoggers())
|
||||||
default_offset = None
|
default_offset = None
|
||||||
@@ -246,7 +249,6 @@ Log files will log the path to tracks relative to this directory.
|
|||||||
default='whipper',
|
default='whipper',
|
||||||
help=("logger to use (choose from: '%s" %
|
help=("logger to use (choose from: '%s" %
|
||||||
"', '".join(loggers) + "')"))
|
"', '".join(loggers) + "')"))
|
||||||
# FIXME: get from config
|
|
||||||
self.parser.add_argument('-o', '--offset',
|
self.parser.add_argument('-o', '--offset',
|
||||||
action="store", dest="offset",
|
action="store", dest="offset",
|
||||||
default=default_offset,
|
default=default_offset,
|
||||||
@@ -415,6 +417,7 @@ Log files will log the path to tracks relative to this directory.
|
|||||||
len(self.itable.tracks),
|
len(self.itable.tracks),
|
||||||
extra))
|
extra))
|
||||||
break
|
break
|
||||||
|
# FIXME: catching too general exception (Exception)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.debug('got exception %r on try %d', e, tries)
|
logger.debug('got exception %r on try %d', e, tries)
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ def main():
|
|||||||
logger.critical("SystemError: %s", e)
|
logger.critical("SystemError: %s", e)
|
||||||
if (isinstance(e, common.EjectError) and
|
if (isinstance(e, common.EjectError) and
|
||||||
cmd.options.eject in ('failure', 'always')):
|
cmd.options.eject in ('failure', 'always')):
|
||||||
|
# XXX: Pylint, instance of 'SystemError' has no 'device' member
|
||||||
eject_device(e.device)
|
eject_device(e.device)
|
||||||
return 255
|
return 255
|
||||||
except RuntimeError as e:
|
except RuntimeError as e:
|
||||||
|
|||||||
@@ -104,8 +104,8 @@ class Persister:
|
|||||||
try:
|
try:
|
||||||
self.object = pickle.load(handle)
|
self.object = pickle.load(handle)
|
||||||
logger.debug('loaded persisted object from %r', self._path)
|
logger.debug('loaded persisted object from %r', self._path)
|
||||||
|
# FIXME: catching too general exception (Exception)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
# TODO: restrict kind of caught exceptions?
|
|
||||||
# can fail for various reasons; in that case, pretend we didn't
|
# can fail for various reasons; in that case, pretend we didn't
|
||||||
# load it
|
# load it
|
||||||
logger.debug(e)
|
logger.debug(e)
|
||||||
@@ -127,7 +127,7 @@ class PersistedCache:
|
|||||||
try:
|
try:
|
||||||
os.makedirs(self.path)
|
os.makedirs(self.path)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
if e.errno != 17: # FIXME
|
if e.errno != os.errno.EEXIST: # FIXME: errno 17 is 'File Exists'
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def _getPath(self, key):
|
def _getPath(self, key):
|
||||||
|
|||||||
@@ -297,6 +297,7 @@ class Program:
|
|||||||
print('Type : %s' % metadata.releaseType)
|
print('Type : %s' % metadata.releaseType)
|
||||||
if metadata.barcode:
|
if metadata.barcode:
|
||||||
print("Barcode : %s" % metadata.barcode)
|
print("Barcode : %s" % metadata.barcode)
|
||||||
|
# TODO: Add test for non ASCII catalog numbers: see issue #215
|
||||||
if metadata.catalogNumber:
|
if metadata.catalogNumber:
|
||||||
print("Cat no : %s" %
|
print("Cat no : %s" %
|
||||||
metadata.catalogNumber.encode('utf-8'))
|
metadata.catalogNumber.encode('utf-8'))
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ class PopenTask(task.Task):
|
|||||||
return
|
return
|
||||||
|
|
||||||
self._done()
|
self._done()
|
||||||
|
# FIXME: catching too general exception (Exception)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.debug('exception during _read(): %s', e)
|
logger.debug('exception during _read(): %s', e)
|
||||||
self.setException(e)
|
self.setException(e)
|
||||||
|
|||||||
1
whipper/extern/freedb.py
vendored
1
whipper/extern/freedb.py
vendored
@@ -134,6 +134,7 @@ def perform_lookup(disc_id, freedb_server, freedb_port):
|
|||||||
|
|
||||||
if len(matches) > 0:
|
if len(matches) > 0:
|
||||||
# for each result, query FreeDB for XMCD file data
|
# for each result, query FreeDB for XMCD file data
|
||||||
|
# XXX: Pylint, redefining argument with the local name 'disc_id'
|
||||||
for (category, disc_id, _) in matches:
|
for (category, disc_id, _) in matches:
|
||||||
sleep(1) # add a slight delay to keep the server happy
|
sleep(1) # add a slight delay to keep the server happy
|
||||||
|
|
||||||
|
|||||||
3
whipper/extern/task/task.py
vendored
3
whipper/extern/task/task.py
vendored
@@ -238,6 +238,7 @@ class Task(LogStub):
|
|||||||
method = getattr(l, methodName)
|
method = getattr(l, methodName)
|
||||||
try:
|
try:
|
||||||
method(self, *args, **kwargs)
|
method(self, *args, **kwargs)
|
||||||
|
# FIXME: catching too general exception (Exception)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.setException(e)
|
self.setException(e)
|
||||||
|
|
||||||
@@ -350,6 +351,7 @@ class BaseMultiTask(Task, ITaskListener):
|
|||||||
task.start(self.runner)
|
task.start(self.runner)
|
||||||
self.debug('BaseMultiTask.next(): started task %d of %d: %r',
|
self.debug('BaseMultiTask.next(): started task %d of %d: %r',
|
||||||
self._task, len(self.tasks), task)
|
self._task, len(self.tasks), task)
|
||||||
|
# FIXME: catching too general exception (Exception)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.setException(e)
|
self.setException(e)
|
||||||
self.debug('Got exception during next: %r', self.exceptionMessage)
|
self.debug('Got exception during next: %r', self.exceptionMessage)
|
||||||
@@ -503,6 +505,7 @@ class SyncRunner(TaskRunner, ITaskListener):
|
|||||||
try:
|
try:
|
||||||
self.debug('start task %r' % task)
|
self.debug('start task %r' % task)
|
||||||
task.start(self)
|
task.start(self)
|
||||||
|
# FIXME: catching too general exception (Exception)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
# getExceptionMessage uses global exception state that doesn't
|
# getExceptionMessage uses global exception state that doesn't
|
||||||
# hang around, so store the message
|
# hang around, so store the message
|
||||||
|
|||||||
@@ -121,6 +121,7 @@ class ImageVerifyTask(task.MultiSeparateTask):
|
|||||||
task.MultiSeparateTask.__init__(self)
|
task.MultiSeparateTask.__init__(self)
|
||||||
|
|
||||||
self._image = image
|
self._image = image
|
||||||
|
# XXX: Pylint, redefining name 'cue' from outer scope (import)
|
||||||
cue = image.cue
|
cue = image.cue
|
||||||
self._tasks = []
|
self._tasks = []
|
||||||
self.lengths = {}
|
self.lengths = {}
|
||||||
@@ -183,6 +184,7 @@ class ImageEncodeTask(task.MultiSeparateTask):
|
|||||||
task.MultiSeparateTask.__init__(self)
|
task.MultiSeparateTask.__init__(self)
|
||||||
|
|
||||||
self._image = image
|
self._image = image
|
||||||
|
# XXX: Pylint, redefining name 'cue' from outer scope (import)
|
||||||
cue = image.cue
|
cue = image.cue
|
||||||
self._tasks = []
|
self._tasks = []
|
||||||
self.lengths = {}
|
self.lengths = {}
|
||||||
|
|||||||
@@ -538,6 +538,7 @@ class ReadVerifyTrackTask(task.MultiSeparateTask):
|
|||||||
try:
|
try:
|
||||||
logger.debug('moving to final path %r', self.path)
|
logger.debug('moving to final path %r', self.path)
|
||||||
os.rename(self._tmppath, self.path)
|
os.rename(self._tmppath, self.path)
|
||||||
|
# FIXME: catching too general exception (Exception)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.debug('exception while moving to final '
|
logger.debug('exception while moving to final '
|
||||||
'path %r: %s', self.path, e)
|
'path %r: %s', self.path, e)
|
||||||
@@ -546,6 +547,7 @@ class ReadVerifyTrackTask(task.MultiSeparateTask):
|
|||||||
os.unlink(self._tmppath)
|
os.unlink(self._tmppath)
|
||||||
else:
|
else:
|
||||||
logger.debug('stop: exception %r', self.exception)
|
logger.debug('stop: exception %r', self.exception)
|
||||||
|
# FIXME: catching too general exception (Exception)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print('WARNING: unhandled exception %r' % (e, ))
|
print('WARNING: unhandled exception %r' % (e, ))
|
||||||
|
|
||||||
|
|||||||
@@ -98,8 +98,6 @@ class WhipperLogger(result.Logger):
|
|||||||
|
|
||||||
# For every track include information in the TOC
|
# For every track include information in the TOC
|
||||||
for t in table.tracks:
|
for t in table.tracks:
|
||||||
# FIXME: what happens to a track start over 60 minutes ?
|
|
||||||
# Answer: tested empirically, everything seems OK
|
|
||||||
start = t.getIndex(1).absolute
|
start = t.getIndex(1).absolute
|
||||||
length = table.getTrackLength(t.number)
|
length = table.getTrackLength(t.number)
|
||||||
end = table.getTrackEnd(t.number)
|
end = table.getTrackEnd(t.number)
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ class TestCase(unittest.TestCase):
|
|||||||
# and we'd like to check for the actual exception under TaskException,
|
# and we'd like to check for the actual exception under TaskException,
|
||||||
# so override the way twisted.trial.unittest does, without failure
|
# so override the way twisted.trial.unittest does, without failure
|
||||||
|
|
||||||
|
# XXX: Pylint, method could be a function (no-self-use)
|
||||||
def failUnlessRaises(self, exception, f, *args, **kwargs):
|
def failUnlessRaises(self, exception, f, *args, **kwargs):
|
||||||
try:
|
try:
|
||||||
result = f(*args, **kwargs)
|
result = f(*args, **kwargs)
|
||||||
|
|||||||
Reference in New Issue
Block a user