class documentation

Config_Collection class.

Method __init__ Initializes a config collection: A list of groups (dictionaries).
Method add_group Appends a group to the collection.
Method del_group Deletes a group from the collection.
Method get_all_groups Gets every group in the collection.
Method get_count Gets the number of groups in the collection.
Method get_group Gets a group from the collection.
Method set Sets a value for some key in a group of the collection.
Instance Variable first_without_suffix Undocumented
Instance Variable gui Undocumented
Instance Variable prefix Undocumented
Instance Variable types Undocumented
Method _get_suffix Gets the suffix for a given group index.
def __init__(self, gui: GUI, prefix: str, types: dict, first_without_suffix: bool):

Initializes a config collection: A list of groups (dictionaries).

Example for the SOMETHING collection, consisting of two groups _0 and _1, each with two keys FOO and BAR: SOMETHING_count = 2 SOMETHING_FOO_0 = "1st value in 1st group" SOMETHING_BAR_0 = "2nd value in 1st group" SOMETHING_FOO_1 = "1st value in 2nd group" SOMETHING_BAR_1 = "2nd value in 2nd group"

Parameters
gui:GUIGUI
prefix:strPrefix
types:dictKey:Type (Dictionary)
first_without_suffix:boolEnable to omit the suffix "_0" for the first group
def add_group(self, values: dict | None):

Appends a group to the collection.

Parameters
values:dict | NoneKey:Value (Dictionary)
def del_group(self, group_index: int):

Deletes a group from the collection.

Parameters
group_index:intGroup index
def get_all_groups(self) -> list[dict]:

Gets every group in the collection.

Returns
list[dict]List of groups (dictionaries)
def get_count(self) -> int:

Gets the number of groups in the collection.

Returns
intNumber of groups in the collection
def get_group(self, group_index: int) -> dict:

Gets a group from the collection.

Parameters
group_index:intGroup index
Returns
dictGroup (dictionary)
def set(self, group_index: int, key: str, value):

Sets a value for some key in a group of the collection.

Parameters
group_index:intGroup index
key:strKey
valueValue
first_without_suffix =

Undocumented

gui =

Undocumented

prefix =

Undocumented

types =

Undocumented

def _get_suffix(self, group_index: int) -> str:

Gets the suffix for a given group index.

Parameters
group_index:intGroup index
Returns
strString