Alle Check Logiken Implementiert

This commit is contained in:
2024-03-14 14:24:37 +01:00
parent 8ec356df70
commit a785eecbc2
3 changed files with 177 additions and 71 deletions
+19
View File
@@ -196,6 +196,25 @@ class TOSGroupsConfig(JsonBasedConfig):
for cId in childIds:
self.get_children_keys(tos_hierarchy, cId, result)
def get_Id2TosGroup(self):
"hole alle ids zur jeweiligen Gruppe"
# lazy. nur einmal laden, wenn noch nicht geschehen
if not self.tos_hierarchy:
self.tos_hierarchy = super().load_json_from_file()
tos_hierarchy = self.tos_hierarchy
num2refId = dict()
num2child = dict()
allkwds = self.get_all_keywords()
for kw in allkwds.keys():
refids = tos_hierarchy[kw]["reference-ids"]
for cId in refids.keys():
num2refId[cId] = refids[cId]
children = tos_hierarchy[kw]["children"]
for cId in children.keys():
num2child[cId] = children[cId]
return (num2refId, num2child)
def get_all_keywords(self):
"""hole alle TOS Keywords, welche in der config Datei definiert sind"""