mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-25 12:05:30 +00:00
Fix CONFIG_DIR issues on windows when ~ does not expand.
This commit is contained in:
parent
528e8c7625
commit
375a7fdc64
1 changed files with 10 additions and 7 deletions
|
@ -44,13 +44,6 @@ def windows_check():
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if windows_check():
|
|
||||||
CONFIG_DIR = os.path.join(os.path.expanduser("~"), 'deluge')
|
|
||||||
if not os.path.exists(CONFIG_DIR):
|
|
||||||
os.mkdir(CONFIG_DIR)
|
|
||||||
else:
|
|
||||||
CONFIG_DIR = xdg.BaseDirectory.save_config_path('deluge')
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
if hasattr(sys, "frozen"):
|
if hasattr(sys, "frozen"):
|
||||||
INSTALL_PREFIX = ''
|
INSTALL_PREFIX = ''
|
||||||
|
@ -61,6 +54,16 @@ else:
|
||||||
# the necessary substitutions are made at installation time
|
# the necessary substitutions are made at installation time
|
||||||
INSTALL_PREFIX = '@datadir@'
|
INSTALL_PREFIX = '@datadir@'
|
||||||
|
|
||||||
|
if windows_check():
|
||||||
|
if os.path.isdir(os.path.expanduser("~")):
|
||||||
|
CONFIG_DIR = os.path.join(os.path.expanduser("~"), 'deluge')
|
||||||
|
else:
|
||||||
|
CONFIG_DIR = os.path.join(INSTALL_PREFIX, 'deluge')
|
||||||
|
if not os.path.exists(CONFIG_DIR):
|
||||||
|
os.mkdir(CONFIG_DIR)
|
||||||
|
else:
|
||||||
|
CONFIG_DIR = xdg.BaseDirectory.save_config_path('deluge')
|
||||||
|
|
||||||
GLADE_DIR = os.path.join(INSTALL_PREFIX, 'share', 'deluge', 'glade')
|
GLADE_DIR = os.path.join(INSTALL_PREFIX, 'share', 'deluge', 'glade')
|
||||||
PIXMAP_DIR = os.path.join(INSTALL_PREFIX, 'share', 'deluge', 'pixmaps')
|
PIXMAP_DIR = os.path.join(INSTALL_PREFIX, 'share', 'deluge', 'pixmaps')
|
||||||
PLUGIN_DIR = os.path.join(INSTALL_PREFIX, 'share', 'deluge', 'plugins')
|
PLUGIN_DIR = os.path.join(INSTALL_PREFIX, 'share', 'deluge', 'plugins')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue