Block
- class Block(previous=None, next=None, data=None)[source]
Class for a generic block in a textfile, with given markers for beginning and end and reading states.
- classmethod begins(line: str | bytes, storage: str = '')[source]
Checks if the current line marks the beginning of the block.
- classmethod ends(line: str | bytes, storage: str = '')[source]
Checks if the current line marks the end of the block.
- read(file: IO, *args, **kwargs) bool [source]
Generic function to perform the reading of the block using a filepointer.
- Parameters:
file (IO) – The filepointer
- Returns:
The success, or not, in the reading
- Return type:
- read_block(file: IO, *args, **kwargs)[source]
Function that reads the block and evaluates the result.
- Parameters:
file (IO) – The filepointer
DefaultBlock
- class DefaultBlock(previous=None, next=None, data=None)[source]
A class for representing a default block, which contains exactly the data from the read line. Mainly used for comments.