20 lines
555 B
Python
20 lines
555 B
Python
from os import path as _pth
|
|
from os import environ as _env
|
|
PKG_NAME = "backup_box"
|
|
PKG_PATH = _pth.abspath(_pth.join(_pth.dirname(__file__), ".."))
|
|
PWD = _pth.abspath(".")
|
|
|
|
def _get_app_config_dirs():
|
|
path = _env.get("XDG_CONFIG_HOME", "")
|
|
if path: yield path
|
|
path = _env.get("LOCALAPPDATA", "")
|
|
if path: yield path
|
|
|
|
def _get_sefault_user_config_dir():
|
|
for dir in _get_app_config_dirs():
|
|
path = _pth.abspath(_pth.join(dir, PKG_NAME))
|
|
return path
|
|
return PWD
|
|
|
|
DEFAULT_USER_CONFIG_DIR = _get_sefault_user_config_dir()
|