Skip to content

Commit

Permalink
Other fixes to stop crashes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescrake-merani committed Oct 4, 2024
1 parent e469310 commit 9eda448
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sasdata/metadata_filename_gui/metadata_tree_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ def __init__(self):
self.setColumnCount(2)
self.setHeaderLabels(['Name', 'Filename Components'])

# TODO: This is placeholder data that'll need to be replaced by the real metadata.

def draw_tree(self):
def draw_tree(self, options: list[str]):
self.clear()
# TODO: This is placeholder data that'll need to be replaced by the real metadata.
metadata = {'Instrument': ['Slit width', 'Other']}
for top_level, items in metadata.items():
top_level_item = QTreeWidgetItem([top_level])
for metadatum in items:
selector = MetadataComponentSelector()
metadatum_item = QTreeWidgetItem([metadatum, selector])
selector.draw_options(options)
top_level_item.addChild(metadatum_item)
self.insertTopLevelItem(top_level_item)
self.insertTopLevelItem(0, top_level_item)

0 comments on commit 9eda448

Please sign in to comment.