mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 13:40:27 +02:00
Better approach for detemining the correct configuration folder for Linux and MacOS, using platformdirs
This commit is contained in:
+3
-4
@@ -66,10 +66,9 @@ def get_version():
|
||||
|
||||
# Define config path
|
||||
def get_user_config_path():
|
||||
if os.name == "nt":
|
||||
config_dir = os.path.join(os.environ["APPDATA"], "abogen")
|
||||
else:
|
||||
config_dir = os.path.join(os.path.expanduser("~"), ".config", "abogen")
|
||||
from platformdirs import user_config_dir
|
||||
# Use platformdirs to get the user configuration directory
|
||||
config_dir = user_config_dir("abogen", appauthor=False, roaming=True)
|
||||
os.makedirs(config_dir, exist_ok=True)
|
||||
return os.path.join(config_dir, "config.json")
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
import json
|
||||
from utils import get_user_config_path, get_resource_path
|
||||
from utils import get_user_config_path
|
||||
|
||||
|
||||
def _get_profiles_path():
|
||||
|
||||
Reference in New Issue
Block a user