Skip to content

Commit

Permalink
Use item.filename instead of getattr
Browse files Browse the repository at this point in the history
  • Loading branch information
roomrys committed Dec 18, 2024
1 parent 69b6273 commit 5b1b7e9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions sleap/gui/dataviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,9 @@ def item_to_data(self, obj, item: "Video"):
data = {}
for property in self.properties:
if property == "name":
filename = getattr(item, "filename")
data[property] = Path(filename).name
data[property] = Path(item.filename).name
elif property == "filepath":
filename = getattr(item, "filename")
data[property] = str(Path(filename).parent)
data[property] = str(Path(item.filename).parent)
else:
data[property] = getattr(item, property)
return data
Expand Down

0 comments on commit 5b1b7e9

Please sign in to comment.