diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2025-03-04 09:56:51 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-04 09:56:51 +0100 |
| commit | f672d713351ade5dbd8f593bf4b329fb19ad8168 (patch) | |
| tree | ececdabdf59f2263c40ffbd4edb0ff4f4f397b0c /lib/gui/presets.py | |
| parent | bef98ef4ebb5af247f349e32f55a6648bf9dbceb (diff) | |
use get_user_dir (#3549)
Diffstat (limited to 'lib/gui/presets.py')
| -rw-r--r-- | lib/gui/presets.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/gui/presets.py b/lib/gui/presets.py index 0457963e..21917d54 100644 --- a/lib/gui/presets.py +++ b/lib/gui/presets.py @@ -4,13 +4,12 @@ # Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details. import json -import os import re import wx from ..i18n import _ -from ..utils import cache +from ..utils import cache, get_user_dir from .dialogs import info_dialog @@ -88,15 +87,7 @@ class PresetsPanel(wx.Panel): @cache def presets_path(self): - try: - import platformdirs - config_path = platformdirs.user_config_dir('inkstitch') - except ImportError: - config_path = os.path.expanduser('~/.inkstitch') - - if not os.path.exists(config_path): - os.makedirs(config_path) - return os.path.join(config_path, '%s.json' % self.suite_name) + return get_user_dir(f'{self.suite_name}.json') def _load_presets(self): try: |
