Skip to content

Commit

Permalink
Replace 'appdirs' with 'platformdirs' (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
reilleya committed Aug 25, 2024
1 parent d8e7faa commit 3a5b372
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
appdirs==1.4.4
cycler==0.11.0
decorator==5.1.1
docopt==0.6.2
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions uilib/fileIO.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions uilib/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys
import traceback
import os
import appdirs
import platformdirs

class Logger():
def __init__(self):
Expand All @@ -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')
Expand Down

0 comments on commit 3a5b372

Please sign in to comment.