summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkg/requirements.pip1
-rw-r--r--src/leap/base/config.py18
2 files changed, 10 insertions, 9 deletions
diff --git a/pkg/requirements.pip b/pkg/requirements.pip
index a8a50fd3..0b0aef26 100644
--- a/pkg/requirements.pip
+++ b/pkg/requirements.pip
@@ -13,6 +13,7 @@ keyring
python-dateutil
sh
pygeoip # optional
+dirspec
# soledad deps -- will move to its own repo soon
python-gnupg
diff --git a/src/leap/base/config.py b/src/leap/base/config.py
index 9583a46a..e2f0beba 100644
--- a/src/leap/base/config.py
+++ b/src/leap/base/config.py
@@ -4,6 +4,7 @@ Configuration Base Class
import grp
import json
import logging
+import re
import socket
import time
import os
@@ -11,6 +12,7 @@ import os
logger = logging.getLogger(name=__name__)
from dateutil import parser as dateparser
+from dirspec import basedir
import requests
from leap.base import exceptions
@@ -279,15 +281,13 @@ def get_config_dir():
@rparam: config path
@rtype: string
"""
- # TODO
- # check for $XDG_CONFIG_HOME var?
- # get a more sensible path for win/mac
- # kclair: opinion? ^^
-
- return os.path.expanduser(
- os.path.join('~',
- '.config',
- 'leap'))
+ home = os.path.expanduser("~")
+ if re.findall("leap_tests-[a-zA-Z0-9]{6}", home):
+ # we're inside a test! :)
+ return os.path.join(home, ".config/leap")
+ else:
+ return os.path.join(basedir.default_config_home,
+ 'leap')
def get_config_file(filename, folder=None):