class documentation

class Config_Collection:

View In Hierarchy

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, prefix, types, first_without_suffix):

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):
Appends a group to the collection.
Parameters
values:Optional[Dict]Key:Value (Dictionary)
def del_group(self, group_index):
Deletes a group from the collection.
Parameters
group_index:intGroup index
def get_all_groups(self):
Gets every group in the collection.
Returns
List[Dict]List of groups (dictionaries)
def get_count(self):
Gets the number of groups in the collection.
Returns
intNumber of groups in the collection
def get_group(self, group_index):
Gets a group from the collection.
Parameters
group_index:intGroup index
Returns
DictGroup (dictionary)
def set(self, group_index, key, 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):
Gets the suffix for a given group index.
Parameters
group_index:intGroup index
Returns
strString