diff options
author | kali <kali@leap.se> | 2013-01-25 07:20:43 +0900 |
---|---|---|
committer | kali <kali@leap.se> | 2013-01-25 07:20:43 +0900 |
commit | a1d880f201c914777daa8f416d5c25ab03e5b05d (patch) | |
tree | a5e9b49dfe62484350cbeb91319a2e2738450689 /src/leap | |
parent | ea00bc02d9722a670067667df752921d2c824389 (diff) |
use dirspec for cross-platform friendly directories
Diffstat (limited to 'src/leap')
-rw-r--r-- | src/leap/base/config.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/leap/base/config.py b/src/leap/base/config.py index 6d43a895..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,7 +12,7 @@ import os logger = logging.getLogger(name=__name__) from dateutil import parser as dateparser -import dirspec +from dirspec import basedir import requests from leap.base import exceptions @@ -280,7 +281,12 @@ def get_config_dir(): @rparam: config path @rtype: string """ - return os.path.join(dirspec.basedir.default_config_home, + 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') |