diff --git a/whipper/command/offset.py b/whipper/command/offset.py index 300d90f9..444c6848 100644 --- a/whipper/command/offset.py +++ b/whipper/command/offset.py @@ -200,7 +200,8 @@ def _arcs(self, runner, table, track, offset): os.unlink(path) return "%08x" % v1, "%08x" % v2 - def _foundOffset(self, device, offset): + @staticmethod + def _foundOffset(device, offset): print('\nRead offset of device is: %d.' % offset) info = drive.getDeviceInfo(device) diff --git a/whipper/common/program.py b/whipper/common/program.py index f1f932d4..1cee7287 100644 --- a/whipper/common/program.py +++ b/whipper/common/program.py @@ -81,7 +81,8 @@ def __init__(self, config, record=False): self._filter = path.PathFilter(**d) - def setWorkingDirectory(self, workingDirectory): + @staticmethod + def setWorkingDirectory(workingDirectory): if workingDirectory: logger.info('changing to working directory %s', workingDirectory) os.chdir(workingDirectory) @@ -140,7 +141,11 @@ def getRipResult(self, cddbdiscid): return self.result - def addDisambiguation(self, template_part, metadata): + def saveRipResult(self): + self._presult.persist() + + @staticmethod + def addDisambiguation(template_part, metadata): """Add disambiguation to template path part string.""" if metadata.catalogNumber: template_part += ' (%s)' % metadata.catalogNumber @@ -218,7 +223,8 @@ def getPath(self, outdir, template, mbdiscid, metadata, track_number=None): template = re.sub(r'%(\w)', r'%(\1)s', template) return os.path.join(outdir, template % v) - def getCDDB(self, cddbdiscid): + @staticmethod + def getCDDB(cddbdiscid): """ @param cddbdiscid: list of id, tracks, offsets, seconds @@ -440,7 +446,8 @@ def getHTOA(self): stop = track.getIndex(1).absolute - 1 return start, stop - def verifyTrack(self, runner, trackResult): + @staticmethod + def verifyTrack(runner, trackResult): is_wave = not trackResult.filename.endswith('.flac') t = checksum.CRC32Task(trackResult.filename, is_wave=is_wave) diff --git a/whipper/extern/task/task.py b/whipper/extern/task/task.py index 9c51771e..3761f16e 100644 --- a/whipper/extern/task/task.py +++ b/whipper/extern/task/task.py @@ -74,13 +74,16 @@ class LogStub(object): I am a stub for a log interface. """ - def log(self, message, *args): + @staticmethod + def log(message, *args): logger.info(message, *args) - def debug(self, message, *args): + @staticmethod + def debug(message, *args): logger.debug(message, *args) - def warning(self, message, *args): + @staticmethod + def warning(message, *args): logger.warning(message, *args) diff --git a/whipper/image/table.py b/whipper/image/table.py index 2cd6ba7c..0b32d4dc 100644 --- a/whipper/image/table.py +++ b/whipper/image/table.py @@ -249,7 +249,8 @@ def hasDataTracks(self): """ return len([t for t in self.tracks if not t.audio]) > 0 - def _cddbSum(self, i): + @staticmethod + def _cddbSum(i): ret = 0 while i > 0: ret += (i % 10) @@ -728,7 +729,8 @@ def merge(self, other, session=2): self.leadout += other.leadout + gap # FIXME logger.debug('fixing leadout, now %d', self.leadout) - def _getSessionGap(self, session): + @staticmethod + def _getSessionGap(session): # From cdrecord multi-session info: # For the first additional session this is 11250 sectors # lead-out/lead-in overhead + 150 sectors for the pre-gap of the first diff --git a/whipper/result/result.py b/whipper/result/result.py index fbde6b27..265514ce 100644 --- a/whipper/result/result.py +++ b/whipper/result/result.py @@ -140,7 +140,8 @@ def log(self, ripResult, epoch=time.time()): class EntryPoint(object): name = 'whipper' - def load(self): + @staticmethod + def load(): from whipper.result import logger return logger.WhipperLogger diff --git a/whipper/test/common.py b/whipper/test/common.py index 2df9f232..b42ffc71 100644 --- a/whipper/test/common.py +++ b/whipper/test/common.py @@ -62,7 +62,8 @@ def failUnlessRaises(self, exception, f, *args, **kwargs): assertRaises = failUnlessRaises - def readCue(self, name): + @staticmethod + def readCue(name): """ Read a .cue file, and replace the version comment with the current version so we can use it in comparisons. diff --git a/whipper/test/test_image_cue.py b/whipper/test/test_image_cue.py index 3bdbc66e..d73333fe 100644 --- a/whipper/test/test_image_cue.py +++ b/whipper/test/test_image_cue.py @@ -59,7 +59,8 @@ def testGetTrackLength(self): class WriteCueFileTestCase(unittest.TestCase): - def testWrite(self): + @staticmethod + def testWrite(): fd, path = tempfile.mkstemp(suffix=u'.whipper.test.cue') os.close(fd) diff --git a/whipper/test/test_image_toc.py b/whipper/test/test_image_toc.py index e7c55969..a51b256c 100644 --- a/whipper/test/test_image_toc.py +++ b/whipper/test/test_image_toc.py @@ -353,7 +353,8 @@ def testIndexes(self): 'strokes-someday.eac.cue')).read()).decode('utf-8') common.diffStrings(ref, cue) - def _filterCue(self, output): + @staticmethod + def _filterCue(output): # helper to be able to compare our generated .cue with the # EAC-extracted one discard = ['TITLE', 'PERFORMER', 'FLAGS', 'REM']