From f672d713351ade5dbd8f593bf4b329fb19ad8168 Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Tue, 4 Mar 2025 09:56:51 +0100 Subject: use get_user_dir (#3549) --- lib/gui/presets.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'lib/gui/presets.py') 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: -- cgit v1.2.3