diff options
| author | Lex Neva <lexelby@users.noreply.github.com> | 2023-02-20 15:27:15 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-20 15:27:15 -0500 |
| commit | 8b98083ac723e4145a7c41483f7dda10f722566f (patch) | |
| tree | 9a058b6aa3c907d3da12d3efdfbc115ef1b4eff4 /lib/utils/paths.py | |
| parent | 43ec2db4516545744051d5762728f287cc19acf6 (diff) | |
| parent | aa65a2bf3fb747dc89e2d905f1fc45b269b5cab4 (diff) | |
Merge pull request #1732 from inkstitch/lexelby/cache-stitch-plan
stitch plan caching
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 |
