diff options
| author | Brian Potchik <brian@vector35.com> | 2022-10-31 15:20:31 -0400 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2022-11-10 16:19:13 -0500 |
| commit | ad42d73cd36d27757e57928f5c1db490fc37fb88 (patch) | |
| tree | 433902b6bffbd2c0fcc4552d604d1bf15c011f1a /python | |
| parent | 51241bb7182524d2f7c6ed32459cf9329c847673 (diff) | |
Add LoadSettingsFile API to support ephemeral settings.
Diffstat (limited to 'python')
| -rw-r--r-- | python/settings.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/python/settings.py b/python/settings.py index 55f0538f..8c0372b4 100644 --- a/python/settings.py +++ b/python/settings.py @@ -158,6 +158,25 @@ class Settings: """Returns the ``instance_id`` for this :class:`Settings` repository (read-only)""" return self._instance_id + """ + ``load_settings_file`` Sets the file that this class:`Settings` instance uses when initially loading, and modifying \ + settings for the specified scope. + + .. note:: At times it may be useful to make ephemeral changes to settings that are not saved to file. This can be accomplished \ + by calling :func:`load_settings_file` without specifying a filename. This action also resets settings to their default value. + + :param str filename: the settings filename + :param scope: the SettingsScope + :param BinaryView view: a BinaryView object + :rtype: bool + """ + def load_settings_file(self, filename=None, scope=SettingsScope.SettingsAutoScope, view=None): + if filename is None: + filename = "" + if view is not None: + view = view.handle + return core.BNLoadSettingsFile(self.handle, filename, scope, view) + def set_resource_id(self, resource_id=None): """ ``set_resource_id`` Sets the resource identifier for this class:`Settings` instance. When accessing setting values at the \ |
