Author: damoxc

Revision: 5255

Log:
        move the config_directory attribute to a property that gets lazily set

Diff:
Modified: trunk/deluge/configmanager.py
===================================================================
--- trunk/deluge/configmanager.py       2009-05-11 04:10:05 UTC (rev 5254)
+++ trunk/deluge/configmanager.py       2009-05-11 10:28:59 UTC (rev 5255)
@@ -35,9 +35,15 @@
     def __init__(self):
         log.debug("ConfigManager started..")
         self.config_files = {}
-        self.config_directory = deluge.common.get_default_config_dir()
+        self.__config_directory = None
         # Set a 5 minute timer to call save()
         gobject.timeout_add(300000, self.save)
+    
+    @property
+    def config_directory(self):
+        if self.__config_directory is None:
+            self.__config_directory = deluge.common.get_default_config_dir()
+        return self.__config_directory
 
     def __del__(self):
         log.debug("ConfigManager stopping..")
@@ -55,7 +61,7 @@
             except Exception, e:
                 log.warning("Unable to make config directory: %s", e)
 
-        self.config_directory = directory
+        self.__config_directory = directory
 
     def get_config_dir(self):
         return self.config_directory



--~--~---------~--~----~------------~-------~--~----~
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