summaryrefslogtreecommitdiff
path: root/alot/ui.py
diff options
context:
space:
mode:
authorJulian Mehne <julian.mehne@posteo.de>2018-01-21 19:08:19 +0100
committerJulian Mehne <julian.mehne@posteo.de>2018-01-21 20:10:09 +0100
commit0935ccfd5c8cd00dd7b55a06133c6b5cf6368668 (patch)
treef6278deddadc2813a226f818eeb3c61f154a0daf /alot/ui.py
parent6f1a8b687dde23458b141c36f3044cf10fa008af (diff)
Fix empty XDG_* environment variables.
Use fallback, if an enviroment variable is unset *or* empty. Bug: - XDG_CONFIG_HOME='' alot Problem: Does not find the configuration file (among others), because os.environ.get('XDG_CONFIG_HOME', '~/.config') returns '', instead of '~/.config'.
Diffstat (limited to 'alot/ui.py')
-rw-r--r--alot/ui.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/alot/ui.py b/alot/ui.py
index c97f2fc1..6c0dea6e 100644
--- a/alot/ui.py
+++ b/alot/ui.py
@@ -18,6 +18,7 @@ from .commands import CommandCanceled
from .commands import CommandParseError
from .helper import split_commandline
from .helper import string_decode
+from .helper import get_env
from .widgets.globals import CompleteEdit
from .widgets.globals import ChoiceWidget
@@ -83,7 +84,7 @@ class UI(object):
# load histories
self._cache = os.path.join(
- os.environ.get('XDG_CACHE_HOME', os.path.expanduser('~/.cache')),
+ get_env('XDG_CACHE_HOME', os.path.expanduser('~/.cache')),
'alot', 'history')
self._cmd_hist_file = os.path.join(self._cache, 'commands')
self._sender_hist_file = os.path.join(self._cache, 'senders')