Skip to content

Commit

Permalink
Use valuea less frequently.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielabdi-noaa committed Mar 29, 2023
1 parent c6ce3b1 commit e1d3c73
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ush/python_utils/config_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,10 +407,11 @@ def xml_to_dict(root, return_string):
cfg[k] = value
else:
cfg_l = {}
if value is None:
cfg_l.update({"attrib": child.attrib})
cfg_l.update({"attrib": child.attrib})
if isinstance(value, dict):
cfg_l.update(value)
else:
cfg_l.update({"attrib": child.attrib, "valuea": value})
cfg_l.update({"valuea": value})
if k in cfg:
cfg[k].append(cfg_l)
else:
Expand Down Expand Up @@ -441,7 +442,7 @@ def dict_to_xml(d, elem):
if isinstance(va, dict):
dict_to_xml(va, child)
else:
child.text = list_to_str(v, True)
child.text = list_to_str(va, True)
elem.append(child)
else:
child = ET.Element(k)
Expand Down

0 comments on commit e1d3c73

Please sign in to comment.