summaryrefslogtreecommitdiff
path: root/src/leap/base/config.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2013-01-25 07:23:04 +0900
committerkali <kali@leap.se>2013-01-25 07:23:04 +0900
commit74fb141d33b195a425f3eece63fdd7bcc0b970ab (patch)
tree51ca9e8fa8375e5b996bcec7818b5db3e88799be /src/leap/base/config.py
parente16d462c4eb24bfc3866e65184ac0b77f5baeb16 (diff)
parenta1d880f201c914777daa8f416d5c25ab03e5b05d (diff)
Merge branch 'feature/dirspec' into develop
Conflicts: pkg/requirements.pip
Diffstat (limited to 'src/leap/base/config.py')
-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):