From 98bc2e2ff9c843a64c3db355290ed541e6708312 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Fri, 29 Jul 2022 18:17:50 -0400 Subject: add preferences UI including cache settings --- lib/utils/paths.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/utils/paths.py') diff --git a/lib/utils/paths.py b/lib/utils/paths.py index 2a95f6e7..10d72de9 100755 --- a/lib/utils/paths.py +++ b/lib/utils/paths.py @@ -7,6 +7,8 @@ import sys import os from os.path import dirname, realpath +import appdirs + def get_bundled_dir(name): if getattr(sys, 'frozen', None) is not None: @@ -26,3 +28,12 @@ def get_resource_dir(name): return realpath(os.path.join(sys._MEIPASS, name)) else: return realpath(os.path.join(dirname(realpath(__file__)), '..', '..', name)) + + +def get_user_dir(name=None): + path = appdirs.user_config_dir("inkstitch") + + if name is not None: + path = os.path.join(path, name) + + return path -- cgit v1.2.3