Пример #1
0
    def testRelativeOutputDirectory(self):
        directory = '.Placebo - Black Market Music (2000)'
        cue = './' + directory + '/Placebo - Black Market Music (2000)'
        track = './' + directory + '/01. Placebo - Taste in Men.flac'

        self.assertEquals(common.getRelativePath(track, cue),
                          '01. Placebo - Taste in Men.flac')
Пример #2
0
    def testRelativeOutputDirectory(self):
        directory = '.Placebo - Black Market Music (2000)'
        cue = './' + directory + '/Placebo - Black Market Music (2000)'
        track = './' + directory + '/01. Placebo - Taste in Men.flac'

        self.assertEquals(common.getRelativePath(track, cue),
                          '01. Placebo - Taste in Men.flac')
Пример #3
0
    def write_m3u(self, discname):
        m3uPath = u'%s.m3u' % discname
        with open(m3uPath, 'w') as f:
            f.write(u'#EXTM3U\n'.encode('utf-8'))
            for track in self.result.tracks:
                if not track.filename:
                    # false positive htoa
                    continue
                if track.number == 0:
                    length = (self.result.table.getTrackStart(1) /
                              common.FRAMES_PER_SECOND)
                else:
                    length = (self.result.table.getTrackLength(track.number) /
                              common.FRAMES_PER_SECOND)

                target_path = common.getRelativePath(track.filename, m3uPath)
                u = u'#EXTINF:%d,%s\n' % (length, target_path)
                f.write(u.encode('utf-8'))
                u = '%s\n' % target_path
                f.write(u.encode('utf-8'))
Пример #4
0
    def write_m3u(self, discname):
        m3uPath = common.truncate_filename(discname + '.m3u')
        with open(m3uPath, 'w') as f:
            f.write('#EXTM3U\n')
            for track in self.result.tracks:
                if not track.filename:
                    # false positive htoa
                    continue
                if track.number == 0:
                    length = (self.result.table.getTrackStart(1) /
                              common.FRAMES_PER_SECOND)
                else:
                    length = (self.result.table.getTrackLength(track.number) /
                              common.FRAMES_PER_SECOND)

                target_path = common.getRelativePath(track.filename, m3uPath)
                u = '#EXTINF:%d,%s\n' % (length, target_path)
                f.write(u)
                u = '%s\n' % target_path
                f.write(u)
Пример #5
0
 def writeFile(path):
     targetPath = common.getRelativePath(path, cuePath)
     line = 'FILE "%s" WAVE' % targetPath
     lines.append(line)
     logger.debug('writeFile: %r' % line)
Пример #6
0
 def writeFile(path):
     targetPath = common.getRelativePath(path, cuePath)
     line = 'FILE "%s" WAVE' % targetPath
     lines.append(line)
     logger.debug('writeFile: %r' % line)
Пример #7
0
 def writeFile(handle, path, length):
     targetPath = common.getRelativePath(path, m3uPath)
     u = u'#EXTINF:%d,%s\n' % (length, targetPath)
     handle.write(u.encode('utf-8'))
     u = '%s\n' % targetPath
     handle.write(u.encode('utf-8'))
Пример #8
0
 def writeFile(handle, path, length):
     targetPath = common.getRelativePath(path, m3uPath)
     u = u'#EXTINF:%d,%s\n' % (length, targetPath)
     handle.write(u.encode('utf-8'))
     u = '%s\n' % targetPath
     handle.write(u.encode('utf-8'))