From 5b1b7e9d24d7b9935cad3b886b2c5f682b2a98c3 Mon Sep 17 00:00:00 2001 From: roomrys <38435167+roomrys@users.noreply.github.com> Date: Tue, 17 Dec 2024 17:24:58 -0800 Subject: [PATCH] Use item.filename instead of getattr --- sleap/gui/dataviews.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sleap/gui/dataviews.py b/sleap/gui/dataviews.py index bd99d1ecf..721bdc321 100644 --- a/sleap/gui/dataviews.py +++ b/sleap/gui/dataviews.py @@ -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