diff options
Diffstat (limited to 'lib/utils/paths.py')
| -rwxr-xr-x | lib/utils/paths.py | 11 |
1 files changed, 11 insertions, 0 deletions
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 |
