Add internal map of UUIDs for future features.

This commit is contained in:
Markus Birth 2021-08-22 21:48:32 +02:00
parent a519764693
commit 139fcbf36a
Signed by: mbirth
GPG Key ID: A9928D7A098C3A9A

View File

@ -47,6 +47,8 @@ def getField(item, designation):
# Load record mappings from Yaml file
RECORD_MAP = yaml.load(open("mappings.yml", "rt"), Loader=yaml.SafeLoader)
uuid_map = {}
for item in opif:
props = item.get_all_props()
@ -65,6 +67,10 @@ for item in opif:
entry = kp.add_entry(target_group_name, item["title"])
fids_done.append("title")
# UUID - memorise for later linking?
uuid_map[props["uuid"]] = entry.uuid
fids_done.append("uuid")
# Icon
kp_icon = RECORD_MAP[item.type]["icon"]
kp.set_icon(kp_icon)