From fc9c291b86beb1650dc9a67051f6f64439adf879 Mon Sep 17 00:00:00 2001 From: Brian Potchik Date: Fri, 6 Feb 2026 12:23:17 -0500 Subject: Add FileMetadata::GetDisplayName API to convey synthesized filenames for container file entries. --- python/filemetadata.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'python') diff --git a/python/filemetadata.py b/python/filemetadata.py index 810d4d17..23965ac9 100644 --- a/python/filemetadata.py +++ b/python/filemetadata.py @@ -223,6 +223,25 @@ class FileMetadata: def virtual_path(self, value: str) -> None: core.BNSetVirtualPath(self.handle, str(value)) + @property + def display_name(self) -> str: + """ + ``display_name`` is the synthesized name for UI display purposes. + + For container entries, this contains a virtual filename representing the extracted artifact (e.g., "/path/to/entry"). + For normal files, this equals ``filename``. + + Use this property for tab titles, save dialog defaults, and other UI display purposes. + Use ``filename`` for the actual physical file path that can be reopened. + + .. note:: For normal files, ``filename`` == ``virtual_path`` == ``display_name``. For container files, ``filename`` is the container path, ``virtual_path`` is the transform chain, and ``display_name`` is the extracted entry name. + """ + return core.BNGetDisplayName(self.handle) + + @display_name.setter + def display_name(self, value: str) -> None: + core.BNSetDisplayName(self.handle, str(value)) + @property def modified(self) -> bool: """Boolean result of whether the file is modified (Inverse of 'saved' property) (read/write)""" -- cgit v1.3.1