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

This commit is contained in:
Andrew Resch 2009-05-15 18:09:59 +00:00
parent be5e12e1e4
commit 8da20c042f
2 changed files with 4 additions and 4 deletions

View File

@ -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:

View File

@ -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: