spinn_storage_handlers package

Submodules

spinn_storage_handlers.buffered_bytearray_data_storage module

class spinn_storage_handlers.buffered_bytearray_data_storage.BufferedBytearrayDataStorage

Bases: spinn_storage_handlers.abstract_classes.abstract_buffered_data_storage.AbstractBufferedDataStorage

Data storage based on a bytearray buffer with two pointers, one for reading and one for writing.

close()
eof()
read(data_size)
read_all()
readinto(data)
seek_read(offset, whence=0)
seek_write(offset, whence=0)
tell_read()
tell_write()
write(data)

spinn_storage_handlers.buffered_file_data_storage module

class spinn_storage_handlers.buffered_file_data_storage.BufferedFileDataStorage(filename, mode)

Bases: spinn_storage_handlers.abstract_classes.abstract_buffered_data_storage.AbstractBufferedDataStorage

Data storage based on a temporary file with two pointers, one for reading and one for writing.

close()
eof()
filename

property method

read(data_size)
read_all()
readinto(data)

See spinn_storage_handlers.abstract_classes.        abstract_buffered_data_storage.AbstractBufferedDataStorage.readinto()

seek_read(offset, whence=0)
seek_write(offset, whence=0)
tell_read()
tell_write()
write(data)

spinn_storage_handlers.buffered_tempfile_data_storage module

class spinn_storage_handlers.buffered_tempfile_data_storage.BufferedTempfileDataStorage

Bases: spinn_storage_handlers.abstract_classes.abstract_buffered_data_storage.AbstractBufferedDataStorage

Data storage based on a temporary file with two pointers, one for reading and one for writing.

close()
eof()
read(data_size)
read_all()
readinto(data)
seek_read(offset, whence=0)
seek_write(offset, whence=0)
tell_read()
tell_write()
write(data)

spinn_storage_handlers.exceptions module

exception spinn_storage_handlers.exceptions.BufferedBytearrayOperationNotImplemented(message)

Bases: exceptions.Exception

An exception that denotes that the operation required is unavailable for a byteArray buffer

Parameters:message (str) – A message to indicate what when wrong
exception spinn_storage_handlers.exceptions.DataReadException(message)

Bases: exceptions.Exception

An exception that indicates that there was an error reading from the underlying medium

Parameters:message (str) – A message to indicate what when wrong
exception spinn_storage_handlers.exceptions.DataWriteException(message)

Bases: exceptions.Exception

An exception that indicates that there was an error writing to the underlying medium

Parameters:message (str) – A message to indicate what when wrong

spinn_storage_handlers.file_data_reader module

class spinn_storage_handlers.file_data_reader.FileDataReader(filename)

Bases: spinn_storage_handlers.abstract_classes.abstract_data_reader.AbstractDataReader

A reader that can read data from a file

Parameters:filename (str) – The file to read
Raises:spinn_storage_handlers.exceptions.DataReadException – If the file cannot found or opened for reading
close()

Closes the file

Return type:None
Raises:spinn_storage_handlers.exceptions.DataReadException – If the file cannot be closed
read(n_bytes)

See data_specification.abstract_data_reader.AbstractDataReader.read()

readall()

See data_specification.abstract_data_reader.AbstractDataReader.readall()

readinto(data)

See data_specification.abstract_data_reader.AbstractDataReader.readinto()

tell()

Returns the position of the file cursor

Returns:Position of the file cursor
Return type:int

spinn_storage_handlers.file_data_writer module

class spinn_storage_handlers.file_data_writer.FileDataWriter(filename)

Bases: spinn_storage_handlers.abstract_classes.abstract_data_writer.AbstractDataWriter

Parameters:filename (str) – The file to write to
Raises:spinn_storage_handlers.exceptions.DataWriteException – If the file cannot found or opened for writing
close()

Closes the file

Return type:None
Raises:spinn_storage_handlers.exceptions.DataWriteException – If the file cannot be closed
filename

property method

tell()

Returns the position of the file cursor

Returns:Position of the file cursor
Return type:int
write(data)

See data_specification.abstract_data_writer.AbstractDataWriter.write()

Module contents