def registerConfigurableInstance(self, configurable): settings = configurable.settings() settings.addListener(configurable) settings.configure(configurable) # Register hooks for path, hook in settings.hooks().items(): handler = hook.fset.__get__( configurable, configurable.__class__) self.registerSettingCallback(path, handler) handler(self.settingValue(path))
def unregisterConfigurableInstance(self, configurable): settings = configurable.settings() settings.removeListener(configurable) # Unregister hooks for path, hook in settings.hooks().items(): self.unregisterSettingCallback(path, hook.fset)