(self)
return True
Read to fill the tape buffer.
Read to fill the tape buffer.
Read to fill the tape buffer .
def _fill_record_buffer(self):
        """Read to fill the tape buffer."""
        if self.buffer_complete:
            return False
        if self.filetype in (b'M', b'B', b'P'):
            # bsave, tokenised and protected come in one multi-block record
            self.record_stream = io.BytesIO()
            self.record_stream.write(self._read_record(self.length))
            self.buffer_complete = True
        else:
            # ascii and data come as a sequence of one-block records
            # 256 bytes less 1 length byte. CRC trailer comes after 256-byte block
            self.record_stream = io.BytesIO()
            record = self._read_record(256)
            num_bytes = ord(record[0:1])
            record = record[1:]
            if num_bytes != 0:
                record = record[:num_bytes-1]
                self.buffer_complete = True
            self.record_stream.write(record)
        self.record_stream.seek(0)
        return True
def _fill_record_buffer ( self ) : if self . buffer_complete : return False if self . filetype in ( b'M' , b'B' , b'P' ) : # bsave, tokenised and protected come in one multi-block record self . record_stream = io . BytesIO ( ) self . record_stream . write ( self . _read_record ( self . length ) ) self . buffer_complete = True else : # ascii and data come as a sequence of one-block records # 256 bytes less 1 length byte. CRC trailer comes after 256-byte block self . record_stream = io . BytesIO ( ) record = self . _read_record ( 256 ) num_bytes = ord ( record [ 0 : 1 ] ) record = record [ 1 : ] if num_bytes != 0 : record = record [ : num_bytes - 1 ] self . buffer_complete = True self . record_stream . write ( record ) self . record_stream . seek ( 0 ) return True