Skip to content
Snippets Groups Projects
Commit 3e6088bb authored by Florian Bruhin's avatar Florian Bruhin
Browse files

Fix getting multiple celltags

parent 33616699
No related branches found
No related tags found
No related merge requests found
......@@ -100,9 +100,12 @@ class OverviewModel(QAbstractTableModel):
if 'celltag' not in props:
return None
celltag = props['celltag']
if isinstance(celltag, list): # running multiple tags
return celltag[0]
return celltag
return self._flatten_celltags(celltag)
def _flatten_celltags(self, tags: str | list[str]) -> str:
if isinstance(tags, list):
return tags[0]
return tags
def _load_tag_mapping(self, reports: list[dict[str, Any]]) -> None:
self._nodeid_to_tag = {
......@@ -112,7 +115,10 @@ class OverviewModel(QAbstractTableModel):
with utils.TAG_MAPPING_FILE.open('r') as f:
from_json = json.load(f)
self._nodeid_to_tag.update(from_json)
self._nodeid_to_tag.update({
k: self._flatten_celltags(v)
for k, v in from_json.items()
})
self.tag_mapping_loaded.emit(self._nodeid_to_tag)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment