def __init__(self, path): """ @type path: unicode @param path: .cue path """ assert type(path) is unicode, "%r is not unicode" % path self._path = path self.cue = cue.CueFile(path) self.cue.parse() self._offsets = [] # 0 .. trackCount - 1 self._lengths = [] # 0 .. trackCount - 1 self.table = None
def move(path): print 'reading', path cuefile = cue.CueFile(path) cuefile.parse() track = cuefile.tracks[0] idx, file = track.getIndex(1) destdir = os.path.dirname(cuefile.getRealPath(file.path)) if os.path.exists(destdir): dirname = os.path.basename(destdir) destination = os.path.join(destdir, dirname + '.cue') print 'moving %s to %s' % (path, destination) os.rename(path, destination)
def setUp(self): self.cue = cue.CueFile(os.path.join(os.path.dirname(__file__), u'kanye.cue')) self.cue.parse() self.assertEquals(len(self.cue.table.tracks), 13)
def main(path): cuefile = cue.CueFile(path) cuefile.parse() print cuefile.tracks