SectionData¶
- class SectionData(root: Section)[source]¶
Class for a storing, managing and accessing data for a section file.
- add_after(after: Section, new: Section) None[source]¶
Adds a new section to the data after another specified section.
- add_before(before: Section, new: Section) None[source]¶
Adds a new section to the data before another specified section.
- append(s: Section) None[source]¶
Appends a section to the end of the data.
- Parameters:
s (Section) – The new section to append to the data
- get_sections_of_type(t: type[_T], **kwargs: object) _T | list[_T] | None[source]¶
A section or section list that only returns sections of type T that meet given filter requirements passed as kwargs.
- Parameters:
t (Type[_T]) – The section type that is desired
- Returns:
Sections filtered by type _T and optional properties
- Return type:
_T | list[_T] | None
- of_type(t: type[_T]) Generator[_T, None, None][source]¶
A section generator that only returns sections of type T.
- Parameters:
t (Type[_T]) – The section type that is desired
- Yield:
Sections filtered by type _T
- Return type:
Generator[_T, None, None]
- preppend(s: Section) None[source]¶
Appends a section to the beginning of the data.
- Parameters:
s (Section) – The new section to preppended to the data.