Make methods static
This commit is contained in:
@@ -81,7 +81,8 @@ class Program:
|
||||
|
||||
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 @@ class Program:
|
||||
|
||||
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 @@ class Program:
|
||||
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 @@ class Program:
|
||||
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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user