summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2011-11-16 09:46:09 +0100
committermathieui <mathieui@mathieui.net>2011-11-16 09:46:09 +0100
commit75f7d710801388b2f62deb98968ff8d4d1f0d350 (patch)
tree50c6828ba8a61ca8ba6c0459d8ad0f5a09b58e5a /src
parentf40f5cb6c21e69abe6693d7cd22ec934d9177610 (diff)
downloadpoezio-75f7d710801388b2f62deb98968ff8d4d1f0d350.tar.gz
poezio-75f7d710801388b2f62deb98968ff8d4d1f0d350.tar.bz2
poezio-75f7d710801388b2f62deb98968ff8d4d1f0d350.tar.xz
poezio-75f7d710801388b2f62deb98968ff8d4d1f0d350.zip
Use os.path.expanduser to interpret '~' for _dir config options
Diffstat (limited to 'src')
-rw-r--r--src/core.py1
-rw-r--r--src/logger.py1
-rw-r--r--src/plugin_manager.py1
-rw-r--r--src/theming.py1
4 files changed, 4 insertions, 0 deletions
diff --git a/src/core.py b/src/core.py
index 311c187d..6bfb4c63 100644
--- a/src/core.py
+++ b/src/core.py
@@ -1340,6 +1340,7 @@ class Core(object):
os.path.join(os.environ.get('XDG_DATA_HOME') or\
os.path.join(os.environ.get('HOME'), '.local', 'share'),
'poezio', 'themes')
+ themes_dir = os.path.expanduser(themes_dir)
try:
names = os.listdir(themes_dir)
except OSError as e:
diff --git a/src/logger.py b/src/logger.py
index bd24eb3b..4f6768cf 100644
--- a/src/logger.py
+++ b/src/logger.py
@@ -16,6 +16,7 @@ import logging
log = logging.getLogger(__name__)
DATA_HOME = config.get('log_dir', '') or os.path.join(environ.get('XDG_DATA_HOME') or os.path.join(environ.get('HOME'), '.local', 'share'), 'poezio')
+DATA_HOME = os.path.expanduser(DATA_HOME)
class Logger(object):
"""
diff --git a/src/plugin_manager.py b/src/plugin_manager.py
index e3b786cb..6d3fb05a 100644
--- a/src/plugin_manager.py
+++ b/src/plugin_manager.py
@@ -10,6 +10,7 @@ plugins_dir = plugins_dir or\
os.path.join(os.environ.get('XDG_DATA_HOME') or\
os.path.join(os.environ.get('HOME'), '.local', 'share'),
'poezio', 'plugins')
+plugins_dir = os.path.expanduser(plugins_dir)
config_home = os.environ.get("XDG_CONFIG_HOME")
if not config_home:
diff --git a/src/theming.py b/src/theming.py
index 0fe45d59..71aa8b72 100644
--- a/src/theming.py
+++ b/src/theming.py
@@ -246,6 +246,7 @@ def reload_theme():
os.path.join(os.environ.get('XDG_DATA_HOME') or\
os.path.join(os.environ.get('HOME'), '.local', 'share'),
'poezio', 'themes')
+ themes_dir = os.path.expanduser(themes_dir)
try:
os.makedirs(themes_dir)
except OSError: