def get_metadata(self): for (chunk_id, chunk_length, chunk_offset) in self.chunks(): if (chunk_id == 'ID3 '): f = open(self.filename, 'rb') f.seek(chunk_offset, 0) id3 = ID3v22Comment.parse(f) f.close() return id3 else: return None
def get_metadata(self): """returns a MetaData object, or None raises IOError if unable to read the file""" from .bitstream import BitstreamReader for chunk in self.chunks(): if (chunk.id == 'ID3 '): return ID3v22Comment.parse(BitstreamReader(chunk.data(), 0)) else: return None
def get_metadata(self): """Returns a MetaData object, or None. Raises IOError if unable to read the file.""" from .bitstream import BitstreamReader for (chunk_id, chunk_size, chunk_data) in self.chunks(): if (chunk_id == 'ID3 '): return ID3v22Comment.parse( BitstreamReader(cStringIO.StringIO(chunk_data), 0)) else: return None
def get_metadata(self): """Returns a MetaData object, or None. Raises IOError if unable to read the file.""" for (chunk_id, chunk_length, chunk_offset) in self.chunks(): if (chunk_id == 'ID3 '): f = open(self.filename, 'rb') f.seek(chunk_offset, 0) id3 = ID3v22Comment.parse(f) f.close() return id3 else: return None