diff --git a/deluge/common.py b/deluge/common.py index d0d04510d..a351154b1 100644 --- a/deluge/common.py +++ b/deluge/common.py @@ -34,7 +34,7 @@ import logging import pkg_resources import xdg, xdg.BaseDirectory -import os.path +import os # Get the logger log = logging.getLogger("deluge") @@ -44,11 +44,14 @@ def get_version(): return pkg_resources.require("Deluge")[0].version def get_config_dir(filename=None): - """ Returns the CONFIG_DIR path if no filename is specified - Returns the CONFIG_DIR + filename as a path if filename is specified + """ Returns the config path if no filename is specified + Returns the config directory + filename as a path if filename is specified """ if filename != None: return os.path.join(xdg.BaseDirectory.save_config_path("deluge"), filename) else: return xdg.BaseDirectory.save_config_path("deluge") +def get_default_download_dir(): + """Returns the default download directory""" + return os.environ.get("HOME") diff --git a/deluge/core/core.py b/deluge/core/core.py index 6ce6e690f..b01780093 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -56,9 +56,10 @@ from deluge.core.torrent import Torrent # Get the logger log = logging.getLogger("deluge") +#_default_download_dir = deluge.common.get_default_download_dir() DEFAULT_PREFS = { "listen_ports": [6881, 6891], - "download_location": "/home/andrew/Downloads", + "download_location": deluge.common.get_default_download_dir(), "compact_allocation": True } diff --git a/deluge/ui/gtkui/gtkui.py b/deluge/ui/gtkui/gtkui.py index 13837d689..8a6103faf 100644 --- a/deluge/ui/gtkui/gtkui.py +++ b/deluge/ui/gtkui/gtkui.py @@ -38,7 +38,7 @@ pygtk.require('2.0') import gtk, gtk.glade import pkg_resources -import gtkui_mainwindow +from mainwindow import MainWindow # Get the logger log = logging.getLogger("deluge") @@ -53,7 +53,7 @@ class GtkUI: pkg_resources.resource_filename("deluge", "glade/main_window.glade")) # Initialize the main window - self.main_window = gtkui_mainwindow.GtkUIMainWindow(self.main_glade) + self.main_window = MainWindow(self.main_glade) # Show the main window self.main_window.show()