From af095afc4bad164177d079d8562801ea8df5da0f Mon Sep 17 00:00:00 2001 From: Brian Potchik Date: Mon, 22 Oct 2018 13:12:42 -0400 Subject: Obtain the BinaryView handle automatically for the Settings set API. --- python/settings.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'python/settings.py') diff --git a/python/settings.py b/python/settings.py index ce7c140a..135cd342 100644 --- a/python/settings.py +++ b/python/settings.py @@ -154,18 +154,28 @@ class Settings(object): return (out_list, SettingsScope(c_scope.value)) def set_bool(self, id, value, view = None, scope = SettingsScope.SettingsAutoScope): + if view is not None: + view = view.handle return core.BNSettingsSetBool(self.registry_id, view, scope, id, value) def set_double(self, id, value, view = None, scope = SettingsScope.SettingsAutoScope): + if view is not None: + view = view.handle return core.BNSettingsSetDouble(self.registry_id, view, scope, id, value) def set_integer(self, id, value, view = None, scope = SettingsScope.SettingsAutoScope): + if view is not None: + view = view.handle return core.BNSettingsSetUInt64(self.registry_id, view, scope, id, value) def set_string(self, id, value, view = None, scope = SettingsScope.SettingsAutoScope): + if view is not None: + view = view.handle return core.BNSettingsSetString(self.registry_id, view, scope, id, value) def set_string_list(self, id, value, view = None, scope = SettingsScope.SettingsAutoScope): + if view is not None: + view = view.handle length = ctypes.c_ulonglong() length.value = len(value) string_list = (ctypes.c_char_p * len(value))() -- cgit v1.3.1