Author: andar

Revision: 5279

Log:
        Clean-up CoreConfig a bit

Diff:
Modified: trunk/deluge/ui/coreconfig.py
===================================================================
--- trunk/deluge/ui/coreconfig.py       2009-05-18 21:34:03 UTC (rev 5278)
+++ trunk/deluge/ui/coreconfig.py       2009-05-18 21:34:24 UTC (rev 5279)
@@ -32,11 +32,17 @@
         log.debug("CoreConfig init..")
         component.Component.__init__(self, "CoreConfig")
         self.config = {}
-        client.register_event_handler("ConfigValueChangedEvent", 
self.on_configvaluechanged_event)
+        def on_configvaluechanged_event(key, value):
+            self.config[key] = value
+        client.register_event_handler("ConfigValueChangedEvent", 
on_configvaluechanged_event)
 
     def start(self):
-        self.start_defer = 
client.core.get_config().addCallback(self._on_get_config)
+        def on_get_config(config):
+            self.config = config
+            return config
 
+        self.start_defer = client.core.get_config().addCallback(on_get_config)
+
     def stop(self):
         self.config = {}
 
@@ -46,12 +52,6 @@
     def __setitem__(self, key, value):
         client.core.set_config({key: value})
 
-    def _on_get_config(self, config):
-        self.config = config
-
-    def on_configvaluechanged_event(self, key, value):
-        self.config[key] = value
-
     def __getattr__(self, attr):
         # We treat this directly interacting with the dictionary
         return getattr(self.config, attr)



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to