spinn_storage_handlers package

Submodules

spinn_storage_handlers.buffered_bytearray_data_storage module

class spinn_storage_handlers.buffered_bytearray_data_storage.BufferedBytearrayDataStorage[source]

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()[source]
eof()[source]
read(data_size)[source]
read_all()[source]
readinto(data)[source]
seek_read(offset, whence=0)[source]
seek_write(offset, whence=0)[source]
tell_read()[source]
tell_write()[source]
write(data)[source]

spinn_storage_handlers.buffered_file_data_storage module

class spinn_storage_handlers.buffered_file_data_storage.BufferedFileDataStorage(filename, mode)[source]

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()[source]
eof()[source]
filename

property method

read(data_size)[source]
read_all()[source]
readinto(data)[source]

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

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

spinn_storage_handlers.buffered_tempfile_data_storage module

class spinn_storage_handlers.buffered_tempfile_data_storage.BufferedTempfileDataStorage[source]

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()[source]
eof()[source]
read(data_size)[source]
read_all()[source]
readinto(data)[source]
seek_read(offset, whence=0)[source]
seek_write(offset, whence=0)[source]
tell_read()[source]
tell_write()[source]
write(data)[source]

spinn_storage_handlers.exceptions module

exception spinn_storage_handlers.exceptions.BufferedBytearrayOperationNotImplemented(message)[source]

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)[source]

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)[source]

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)[source]

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()[source]

Closes the file

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

See data_specification.abstract_data_reader.AbstractDataReader.read()

readall()[source]

See data_specification.abstract_data_reader.AbstractDataReader.readall()

readinto(data)[source]

See data_specification.abstract_data_reader.AbstractDataReader.readinto()

tell()[source]

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)[source]

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()[source]

Closes the file

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

property method

tell()[source]

Returns the position of the file cursor

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

See data_specification.abstract_data_writer.AbstractDataWriter.write()

Module contents