Search for itemSection instead of using fixed index (fixes #8)

This commit is contained in:
sigma67 2020-04-21 11:47:19 +02:00
commit 826a72c817
No known key found for this signature in database
GPG key ID: 1545A01D4474BAF0
2 changed files with 12 additions and 3 deletions

View file

@ -135,4 +135,11 @@ def get_item_text(item, index, run_index=0):
def nav(root, items):
"""Access a nested object in root by item sequence."""
for k in items: root = root[k]
return root
return root
def find_object_by_key(object_list, key):
for item in object_list:
if key in item:
return item
return None