diff --git a/scripts/deluge b/scripts/deluge index 8c4ca30ba..c2e643bd8 100755 --- a/scripts/deluge +++ b/scripts/deluge @@ -45,7 +45,6 @@ import deluge.common import deluge.core import deluge._dbus as dbus import deluge.interface -import deluge.pref parser = OptionParser(usage="%prog [options] [torrents to add]", version=deluge.common.PROGRAM_VERSION) diff --git a/src/core.py b/src/core.py index c26da32cd..f1a8c8f21 100644 --- a/src/core.py +++ b/src/core.py @@ -193,14 +193,16 @@ class persistent_state: class Manager: # blank_slate mode ignores the two pickle files and DHT state file, i.e. you start # completely fresh. When quitting, the old files will be overwritten - def __init__(self, client_ID, version, user_agent, base_dir, blank_slate=False): + def __init__(self, client_ID, version, user_agent, base_dir, blank_slate=False, base_change=False): self.base_dir = base_dir # Keeps track of DHT running state self.dht_running = False # Load the preferences self.config = pref.Preferences(os.path.join(self.base_dir, PREFS_FILENAME)) - + if base_change: + self.config.set("default_torrent_path", os.path.join(self.base_dir, "torrentfiles")) + self.config.save() TORRENTS_SUBDIR = self.config.get("default_torrent_path") # Ensure directories exist diff --git a/src/interface.py b/src/interface.py index 80634c18c..97e45132e 100644 --- a/src/interface.py +++ b/src/interface.py @@ -49,11 +49,13 @@ class DelugeGTK: def __init__(self, config_dir=None): if config_dir: common.CONFIG_DIR = config_dir + base_change = True self.ipc_manager = ipc_manager.Manager(self) #Start the Deluge Manager: self.manager = core.Manager(common.CLIENT_CODE, common.CLIENT_VERSION, '%s %s' % (common.PROGRAM_NAME, common.PROGRAM_VERSION), - common.CONFIG_DIR) + common.CONFIG_DIR, base_change=base_change) + self.plugins = plugins.PluginManager(self.manager, self) self.plugins.add_plugin_dir(common.PLUGIN_DIR) if os.path.isdir(os.path.join(common.CONFIG_DIR , 'plugins')):