From 8da20c042ff2c10f8190cae06cf6854d2f7381eb Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Fri, 15 May 2009 18:09:59 +0000 Subject: [PATCH] Fix some config file locations when using a non-default config directory --- deluge/core/core.py | 6 +++--- deluge/core/preferencesmanager.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/deluge/core/core.py b/deluge/core/core.py index b659c1386..8c811c402 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -151,7 +151,7 @@ class Core(component.Component): 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 @@ class Core(component.Component): """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: diff --git a/deluge/core/preferencesmanager.py b/deluge/core/preferencesmanager.py index 4f8cc7ca3..e5babac95 100644 --- a/deluge/core/preferencesmanager.py +++ b/deluge/core/preferencesmanager.py @@ -276,7 +276,7 @@ class PreferencesManager(component.Component): 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: