Section

class Section(previous=None, next=None, data=None)[source]

Class for a generic section in a textfile, which begins and ends in a given order

read(file: IO, *args, **kwargs) bool[source]

Generic function to perform the reading of the section using a filepointer.

Parameters:

file (IO) – The filepointer

Returns:

The success, or not, in the reading

Return type:

bool

read_section(file: IO, *args, **kwargs)[source]

Function that reads the section and evaluates the result.

Parameters:

file (IO) – The filepointer

write(file: IO, *args, **kwargs) bool[source]

Generic function to perform the writing of the section using a filepointer.

Parameters:

file (IO) – The filepointer

Returns:

The success, or not, in the writing

Return type:

bool

write_section(file: IO, *args, **kwargs)[source]

Function that writes the section, if it was succesfully read.

Parameters:

file (IO) – The filepointer

DefaultSection

class DefaultSection(previous=None, next=None, data=None)[source]

A class for representing a default section, which contains no data and is used for representing empty data.

read(file: IO, *args, **kwargs) bool[source]

Generic function to perform the reading of the section using a filepointer.

Parameters:

file (IO) – The filepointer

Returns:

The success, or not, in the reading

Return type:

bool

write(file: IO, *args, **kwargs) bool[source]

Generic function to perform the writing of the section using a filepointer.

Parameters:

file (IO) – The filepointer

Returns:

The success, or not, in the writing

Return type:

bool