示例#1
0
 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))
示例#2
0
 def unregisterConfigurableInstance(self, configurable):
     settings = configurable.settings()
     settings.removeListener(configurable)
     # Unregister hooks
     for path, hook in settings.hooks().items():
         self.unregisterSettingCallback(path, hook.fset)