summaryrefslogtreecommitdiff
path: root/python/filemetadata.py
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2021-10-15 14:16:06 -0400
committerGlenn Smith <glenn@vector35.com>2021-10-15 17:52:27 -0400
commit139520e51c3b7f8c3fd5c4c553dd13e12ffd744d (patch)
tree5d064f2d077cda44ea082f6249efe085cf38b59f /python/filemetadata.py
parente6ca3a951901ff7167c518d6fa52c0d4311b893a (diff)
Database python api
Diffstat (limited to 'python/filemetadata.py')
-rw-r--r--python/filemetadata.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/python/filemetadata.py b/python/filemetadata.py
index a8c738c2..0f74aa19 100644
--- a/python/filemetadata.py
+++ b/python/filemetadata.py
@@ -29,6 +29,7 @@ from .enums import SaveOption
from . import associateddatastore #required for _FileMetadataAssociatedDataStore
from .log import log_error
from . import binaryview
+from . import database
ProgressFuncType = Callable[[int, int], bool]
ViewName = str
@@ -245,6 +246,14 @@ class FileMetadata:
return binaryview.BinaryView(file_metadata = self, handle = view)
@property
+ def database(self) -> Optional['database.Database']:
+ """Gets the backing Database of the file"""
+ handle = core.BNGetFileMetadataDatabase(self.handle)
+ if handle is None:
+ return None
+ return database.Database(handle=handle)
+
+ @property
def saved(self) -> bool:
"""Boolean result of whether the file has been saved (Inverse of 'modified' property) (read/write)"""
return not core.BNIsFileModified(self.handle)