Author: andar

Revision: 5270

Log:
        Fix some config file locations when using a non-default config directory

Diff:
Modified: branches/1.1.0_RC/deluge/core/core.py
===================================================================
--- branches/1.1.0_RC/deluge/core/core.py       2009-05-15 17:48:03 UTC (rev 
5269)
+++ branches/1.1.0_RC/deluge/core/core.py       2009-05-15 18:09:59 UTC (rev 
5270)
@@ -297,7 +297,7 @@
     def save_session_state(self):
         """Saves the libtorrent session state"""
         try:
-            open(deluge.common.get_default_config_dir("session.state"), 
"wb").write(
+            open(deluge.configmanager.get_config_dir("session.state"), 
"wb").write(
                 lt.bencode(self.session.state()))
         except Exception, e:
             log.warning("Failed to save lt state: %s", e)
@@ -306,14 +306,14 @@
         """Loads the libtorrent session state"""
         try:
             self.session.load_state(lt.bdecode(
-                open(deluge.common.get_default_config_dir("session.state"), 
"rb").read()))
+                open(deluge.configmanager.get_config_dir("session.state"), 
"rb").read()))
         except Exception, e:
             log.warning("Failed to load lt state: %s", e)
 
     def save_dht_state(self):
         """Saves the dht state to a file"""
         try:
-            dht_data = open(deluge.common.get_default_config_dir("dht.state"), 
"wb")
+            dht_data = open(deluge.configmanager.get_config_dir("dht.state"), 
"wb")
             dht_data.write(lt.bencode(self.session.dht_state()))
             dht_data.close()
         except Exception, e:

Modified: branches/1.1.0_RC/deluge/core/preferencesmanager.py
===================================================================
--- branches/1.1.0_RC/deluge/core/preferencesmanager.py 2009-05-15 17:48:03 UTC 
(rev 5269)
+++ branches/1.1.0_RC/deluge/core/preferencesmanager.py 2009-05-15 18:09:59 UTC 
(rev 5270)
@@ -287,7 +287,7 @@
 
     def _on_set_dht(self, key, value):
         log.debug("dht value set to %s", value)
-        state_file = deluge.common.get_default_config_dir("dht.state")
+        state_file = deluge.configmanager.get_config_dir("dht.state")
         if value:
             state = None
             try:

Modified: trunk/deluge/core/core.py
===================================================================
--- trunk/deluge/core/core.py   2009-05-15 17:48:03 UTC (rev 5269)
+++ trunk/deluge/core/core.py   2009-05-15 18:09:59 UTC (rev 5270)
@@ -151,7 +151,7 @@
     def __save_session_state(self):
         """Saves the libtorrent session state"""
         try:
-            open(deluge.common.get_default_config_dir("session.state"), 
"wb").write(
+            open(deluge.configmanager.get_config_dir("session.state"), 
"wb").write(
                 lt.bencode(self.session.state()))
         except Exception, e:
             log.warning("Failed to save lt state: %s", e)
@@ -160,14 +160,14 @@
         """Loads the libtorrent session state"""
         try:
             self.session.load_state(lt.bdecode(
-                open(deluge.common.get_default_config_dir("session.state"), 
"rb").read()))
+                open(deluge.configmanager.get_config_dir("session.state"), 
"rb").read()))
         except Exception, e:
             log.warning("Failed to load lt state: %s", e)
 
     def save_dht_state(self):
         """Saves the dht state to a file"""
         try:
-            dht_data = open(deluge.common.get_default_config_dir("dht.state"), 
"wb")
+            dht_data = open(deluge.configmanager.get_config_dir("dht.state"), 
"wb")
             dht_data.write(lt.bencode(self.session.dht_state()))
             dht_data.close()
         except Exception, e:

Modified: trunk/deluge/core/preferencesmanager.py
===================================================================
--- trunk/deluge/core/preferencesmanager.py     2009-05-15 17:48:03 UTC (rev 
5269)
+++ trunk/deluge/core/preferencesmanager.py     2009-05-15 18:09:59 UTC (rev 
5270)
@@ -276,7 +276,7 @@
 
     def _on_set_dht(self, key, value):
         log.debug("dht value set to %s", value)
-        state_file = deluge.common.get_default_config_dir("dht.state")
+        state_file = deluge.configmanager.get_config_dir("dht.state")
         if value:
             state = None
             try:



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