From 3a5b372badf92298e93ffeca0713d113f97f4323 Mon Sep 17 00:00:00 2001 From: Andrew Reilley Date: Sat, 24 Aug 2024 22:55:36 -0400 Subject: [PATCH] Replace 'appdirs' with 'platformdirs' (#225) --- requirements.txt | 2 +- uilib/fileIO.py | 4 ++-- uilib/logger.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/requirements.txt b/requirements.txt index 77c55d5..cfc02d0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ -appdirs==1.4.4 cycler==0.11.0 decorator==5.1.1 docopt==0.6.2 @@ -8,6 +7,7 @@ matplotlib==3.7.1 networkx==3.1 numpy==1.24.3 Pillow==9.5.0 +platformdirs==4.2.2 pyparsing==3.0.9 pyqt-distutils==0.7.3 PyQt6==6.4.2 diff --git a/uilib/fileIO.py b/uilib/fileIO.py index 6d8253b..5233462 100644 --- a/uilib/fileIO.py +++ b/uilib/fileIO.py @@ -4,7 +4,7 @@ from PyQt6.QtWidgets import QApplication import yaml -import appdirs +import platformdirs from .defaults import DEFAULT_PREFERENCES, DEFAULT_PROPELLANTS, KNSU_PROPS from .logger import logger @@ -59,7 +59,7 @@ def loadFile(path, dataType): # Mac OS put these files alongside the executable, but the v0.5.0 added an installer for windows so it makes more # sense to use the user's data directory now. def getConfigPath(): - path = appdirs.user_data_dir('openMotor', 'openMotor') + path = platformdirs.user_data_dir('openMotor', 'openMotor') if not os.path.isdir(path): # Create directory if it doesn't exist os.mkdir(path) return '{}/'.format(path) diff --git a/uilib/logger.py b/uilib/logger.py index c26fd49..8a05dc5 100644 --- a/uilib/logger.py +++ b/uilib/logger.py @@ -3,7 +3,7 @@ import sys import traceback import os -import appdirs +import platformdirs class Logger(): def __init__(self): @@ -16,7 +16,7 @@ def __init__(self): self.log('Application started at {}'.format(startDate)) def _openLogFile(self): - path = appdirs.user_log_dir('openMotor', 'openMotor') + path = platformdirs.user_log_dir('openMotor', 'openMotor') if not os.path.isdir(path): os.makedirs(path) self._file = open(os.path.join(path, "openMotor.log"), 'a')