Skip to content

Commit

Permalink
Update metadata support to only key-value entries
Browse files Browse the repository at this point in the history
  • Loading branch information
jameno committed Mar 27, 2020
1 parent 79bcdd1 commit 41159cb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apple_health_xml_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ def convert_xml():
child_attrib = child.attrib
for metadata_entry in list(child):
metadata_values = list(metadata_entry.attrib.values())
metadata_dict = {metadata_values[0] : metadata_values[1]}
child_attrib.update(metadata_dict)
if len(metadata_values) == 2:
metadata_dict = {metadata_values[0]: metadata_values[1]}
child_attrib.update(metadata_dict)

attribute_list.append(child_attrib)

Expand Down

0 comments on commit 41159cb

Please sign in to comment.