Skip to content

Commit

Permalink
add support for unique string types
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotan committed Nov 5, 2024
1 parent 366fcb9 commit f7ac175
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nxstools/nxsfileinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -1981,7 +1981,7 @@ def _merge_string(cls, parent, key, md, tgtype=None):
tg = None
if key in parent.keys():
tg = parent[key]
if tgtype in cls.listtype:
if tgtype in cls.listtype or tgtype in cls.uniquelisttype:
if not isinstance(tg, list):
if tg:
parent[key] = [tg]
Expand Down Expand Up @@ -2009,7 +2009,8 @@ def _merge_string(cls, parent, key, md, tgtype=None):
else:
parent[key][1] = md
elif key in parent and isinstance(parent[key], list):
parent[key].append(md)
if tgtype not in cls.uniquelisttype or md not in parent[key]:
parent[key].append(md)
elif not tg:
parent[key] = md
elif tg != md:
Expand Down

0 comments on commit f7ac175

Please sign in to comment.