TOS Gruppen json Datei vervollständigt. Nur TOS Ids mit Referenzen werden jetzt mit rausgeschrieben. Falls eine reference Id existiert, welche nicht verwendet wird, wird diese weggelassen.
This commit is contained in:
+7
-3
@@ -14,13 +14,16 @@ Codebereich liegt bei Calk Link 10
|
||||
|
||||
"""
|
||||
def get_children_keys(tos_hierarchy, currentId, result):
|
||||
# wenn eine Referenz nicht weiter in der TOS Hierarchy vorkommt, dann nicht mit einsammeln
|
||||
if currentId not in tos_hierarchy:
|
||||
return None
|
||||
childIds = tos_hierarchy[currentId]["reference-ids"].values()
|
||||
level = tos_hierarchy[currentId]["TOS-level"]
|
||||
if len(childIds) > 0:
|
||||
for cId in childIds:
|
||||
result[cId] = level
|
||||
# prüfen, ob die Referenz sonst noch verwendet wird
|
||||
if cId in tos_hierarchy:
|
||||
result[cId] = level
|
||||
for cId in childIds:
|
||||
get_children_keys(tos_hierarchy, cId, result)
|
||||
|
||||
@@ -30,6 +33,8 @@ def get_all_keywords(tos_hierarchy):
|
||||
rootid = tos_hierarchy["root"]
|
||||
# und von dort aus alle Referenzen
|
||||
result = dict()
|
||||
# root als Nullte Ebene dazu
|
||||
result[rootid] = 0
|
||||
get_children_keys(tos_hierarchy, rootid, result)
|
||||
return result
|
||||
|
||||
@@ -51,9 +56,8 @@ def create_tos_string(config_path):
|
||||
allKeywords = get_all_keywords(tos_hierarchy)
|
||||
|
||||
myIds = list()
|
||||
for level in range(1,5):
|
||||
for level in range(0,5):
|
||||
myIds.extend(get_keywords_of_level(allKeywords, level))
|
||||
print(myIds)
|
||||
|
||||
res += '")&EdmCodVal("'.join(myIds)
|
||||
res += '")'
|
||||
|
||||
Reference in New Issue
Block a user