(self, contents)
Set the contents of the buffer.
Set the contents of the buffer.
Set the contents of the buffer .
def set_buffer(self, contents):
        """Set the contents of the buffer."""
        # take contents and pad with NULL to required size
        try:
            self._field.view_buffer()[:self._reclen] = contents.ljust(self._reclen, b'\0')
        except ValueError:
            # can't modify size of memoryview
            raise error.BASICError(error.FIELD_OVERFLOW)
        # reset field text file loc
        self._fhandle.seek(0)
def set_buffer ( self , contents ) : # take contents and pad with NULL to required size try : self . _field . view_buffer ( ) [ : self . _reclen ] = contents . ljust ( self . _reclen , b'\0' ) except ValueError : # can't modify size of memoryview raise error . BASICError ( error . FIELD_OVERFLOW ) # reset field text file loc self . _fhandle . seek ( 0 )