summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/leap/base/config.py18
1 files changed, 9 insertions, 9 deletions
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):