diff --git a/mutagen/_riff.py b/mutagen/_riff.py index 854bdfab..ba8bf80c 100644 --- a/mutagen/_riff.py +++ b/mutagen/_riff.py @@ -101,7 +101,7 @@ class RiffFile(object): """ def __init__(self, fileobj): - self.__fileobj = fileobj + self._fileobj = fileobj self.__riffChunks = {} # Reset read pointer to beginning of RIFF file @@ -152,7 +152,7 @@ def __getitem__(self, id_): return self.__riffChunks[id_] except KeyError: raise KeyError( - "%r has no %r chunk" % (self.__fileobj, id_)) + "%r has no %r chunk" % (self.fileobj, id_)) def __delitem__(self, id_): """Remove a chunk from the IFF file""" @@ -172,10 +172,10 @@ def insert_chunk(self, id_): if not is_valid_chunk_id(id_): raise KeyError("RIFF key must be four ASCII characters.") - self.__fileobj.seek(self.__next_offset) - self.__fileobj.write(pack('>4si', id_.ljust(4).encode('ascii'), 0)) - self.__fileobj.seek(self.__next_offset) - chunk = RiffChunkHeader(self.__fileobj, self[u'RIFF']) + self.fileobj.seek(self.__next_offset) + self.fileobj.write(pack('>4si', id_.ljust(4).encode('ascii'), 0)) + self.fileobj.seek(self.__next_offset) + chunk = RiffChunkHeader(self.fileobj, self[u'RIFF']) self[u'RIFF']._update_size(self[u'RIFF'].data_size + chunk.size) self.__riffChunks[id_] = chunk diff --git a/mutagen/wave.py b/mutagen/wave.py index 11dcaab7..1ff2036e 100644 --- a/mutagen/wave.py +++ b/mutagen/wave.py @@ -173,7 +173,7 @@ def __getitem__(self, id_): return self.__wavChunks[id_] except KeyError: raise KeyError( - "%r has no %r chunk" % (self._RiffFile__fileobj, id_)) + "%r has no %r chunk" % (self._fileobj, id_)) def __delitem__(self, id_): """Remove a chunk from the RIFF/WAVE file""" @@ -187,11 +187,10 @@ def insert_chunk(self, id_): check_id(id_) - self._RiffFile__fileobj.seek(self.__next_offset) - self._RiffFile__fileobj.write(pack('<4si', - id_.ljust(4).encode('ascii'), 0)) - self._RiffFile__fileobj.seek(self.__next_offset) - chunk = RiffChunkHeader(self._RiffFile__fileobj) + self._fileobj.seek(self.__next_offset) + self._fileobj.write(pack('<4si', id_.ljust(4).encode('ascii'), 0)) + self._fileobj.seek(self.__next_offset) + chunk = RiffChunkHeader(self._fileobj) self[u'RIFF']._update_size(self[u'RIFF'].data_size + chunk.size) self.__wavChunks[id_] = chunk @@ -199,9 +198,9 @@ def insert_chunk(self, id_): class WaveStreamInfo(StreamInfo): - """RiffWave() + """WaveStreamInfo() - Microsoft WAVE soundfile information. + Microsoft WAVE file information. Information is parsed from the 'fmt ' & 'data'chunk of the RIFF/WAVE file