Skip to content

Commit

Permalink
Merge pull request #36 from gdcc/fix-tuple-bug-2
Browse files Browse the repository at this point in the history
Fix Tuple Bug [Transferred]
  • Loading branch information
JR-1991 authored Nov 11, 2024
2 parents f4518a0 + f414df3 commit be66167
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions easyDataverse/dataverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,13 +479,19 @@ def _extract_data(self, fields: List, tree: Node):
data = {}

for field in fields:
node = findall_by_attr(tree, field.typeName, "typeName")[0]
name = node.name
dvtype = node.typeClass
result = findall_by_attr(tree, field.typeName, "typeName")

if dvtype.lower() == "compound":
data[name] = self._process_compound(field.value, tree)
if len(result) > 0:
node = result[0]
name = node.name
dvtype = node.typeClass

if dvtype.lower() == "compound":
data[name] = self._process_compound(field.value, tree)
else:
data[name] = field.value
else:
name = field.typeName
data[name] = field.value

return data
Expand Down

0 comments on commit be66167

Please sign in to comment.