3 def getConfigDirectory():
4 d = os.environ.get("XDG_CONFIG_HOME")
6 return os.path.join(d, "lilass")
7 d = os.path.expanduser("~")
9 return os.path.join(d, ".config", "lilass")
10 raise Exception("Couldn't find config directory")
12 def getDataDirectory():
13 d = os.environ.get("XDG_DATA_HOME")
15 return os.path.join(d, "lilass")
16 d = os.path.expanduser("~")
18 return os.path.join(d, ".local", "share", "lilass")
19 raise Exception("Couldn't find data directory.")
21 def mkdirP(path, mode=0o700):
22 os.makedirs(path, mode=mode, exist_ok=True)