diff options
| author | Brian Potchik <brian@vector35.com> | 2026-02-06 12:23:17 -0500 |
|---|---|---|
| committer | Brian Potchik <brian@vector35.com> | 2026-02-06 12:23:17 -0500 |
| commit | fc9c291b86beb1650dc9a67051f6f64439adf879 (patch) | |
| tree | a841073c856c8839ab10c56afb0209b38ed7bbe0 /python | |
| parent | 7e47e9e4b012d7c10fb54a59b7c68b3a1715ee5a (diff) | |
Add FileMetadata::GetDisplayName API to convey synthesized filenames for container file entries.
Diffstat (limited to 'python')
| -rw-r--r-- | python/filemetadata.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/python/filemetadata.py b/python/filemetadata.py index 810d4d17..23965ac9 100644 --- a/python/filemetadata.py +++ b/python/filemetadata.py @@ -224,6 +224,25 @@ class FileMetadata: 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)""" return core.BNIsFileModified(self.handle) |
