mirror of https://gitlab.com/openlp/openlp.git
Replace appdirs with platformdirs
This commit is contained in:
parent
8c3d9b5742
commit
c74bc27b48
|
@ -31,7 +31,7 @@ install:
|
|||
# Update pip
|
||||
- python -m pip install --upgrade pip
|
||||
# Install generic dependencies from pypi.
|
||||
- python -m pip install sqlalchemy alembic appdirs chardet beautifulsoup4 lxml Mako mysql-connector-python pytest mock psycopg2-binary websockets waitress six requests QtAwesome PyQt5 PyQtWebEngine pymediainfo PyMuPDF QDarkStyle python-vlc flask-cors pytest-qt pyenchant pysword qrcode flask
|
||||
- python -m pip install sqlalchemy alembic platformdirs chardet beautifulsoup4 lxml Mako mysql-connector-python pytest mock psycopg2-binary websockets waitress six requests QtAwesome PyQt5 PyQtWebEngine pymediainfo PyMuPDF QDarkStyle python-vlc flask-cors pytest-qt pyenchant pysword qrcode flask
|
||||
# Install Windows only dependencies
|
||||
- cmd: python -m pip install pyodbc pypiwin32
|
||||
- cmd: choco install vlc %CHOCO_VLC_ARG% --no-progress --limit-output
|
||||
|
|
|
@ -26,7 +26,7 @@ import os
|
|||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from appdirs import AppDirs
|
||||
from platformdirs import PlatformDirs
|
||||
|
||||
import openlp
|
||||
from openlp.core.common import get_frozen_path
|
||||
|
@ -142,7 +142,7 @@ def _get_os_dir_path(dir_type):
|
|||
return Path(openlp.__file__).parent
|
||||
return openlp_folder_path
|
||||
|
||||
dirs = AppDirs('openlp', multipath=True)
|
||||
dirs = PlatformDirs('openlp', multipath=True)
|
||||
if is_macosx():
|
||||
openlp_folder_path = Path(dirs.user_data_dir)
|
||||
if dir_type == AppLocation.DataDir:
|
||||
|
|
|
@ -125,7 +125,7 @@ class UiAboutDialog(object):
|
|||
'<li><a href="https://www.python.org/">Python</a> (PSFL)</li>'
|
||||
'<li><a href="https://www.qt.io">Qt5</a> (GPL3/LGPL3)</li>'
|
||||
'<li><a href="https://www.riverbankcomputing.co.uk/software/pyqt/intro">PyQt5</a> (GPL3)</li>'
|
||||
'<li><a href="https://github.com/ActiveState/appdirs">appdirs</a> (MIT)</li>'
|
||||
'<li><a href="https://github.com/platformdirs/platformdirs">platformdirs</a> (MIT)</li>'
|
||||
'<li><a href="https://alembic.sqlalchemy.org/en/latest/">Alembic</a> (MIT)</li>'
|
||||
'<li><a href="https://www.crummy.com/software/BeautifulSoup/">BeautifulSoup 4</a> (MIT)</li>'
|
||||
'<li><a href="https://github.com/chardet/chardet">chardet</a> (LGPL)</li>'
|
||||
|
|
|
@ -79,7 +79,7 @@ MODULES = [
|
|||
'PyQt5.QtTest',
|
||||
('PyQt5.QtWebEngineWidgets', '(PyQtWebEngine on PyPI)'),
|
||||
'PyQt5.QtMultimedia',
|
||||
'appdirs',
|
||||
'platformdirs',
|
||||
'sqlalchemy',
|
||||
'alembic',
|
||||
'lxml',
|
||||
|
|
2
setup.py
2
setup.py
|
@ -97,7 +97,6 @@ using a computer and a display/projector.""",
|
|||
python_requires='>=3.6',
|
||||
install_requires=[
|
||||
'alembic',
|
||||
'appdirs',
|
||||
'beautifulsoup4',
|
||||
'chardet',
|
||||
'dbus-python; platform_system=="Linux"',
|
||||
|
@ -106,6 +105,7 @@ using a computer and a display/projector.""",
|
|||
'flask-cors',
|
||||
'lxml',
|
||||
'Mako',
|
||||
'platformdirs',
|
||||
'PyICU',
|
||||
'pymediainfo >= 2.2',
|
||||
'pyobjc; platform_system=="Darwin"',
|
||||
|
|
|
@ -226,9 +226,9 @@ def test_get_directory_for_language_dir_from_macosx(mocked_getenv, mocked_is_mac
|
|||
@patch('openlp.core.common.applocation.resolve')
|
||||
@patch('openlp.core.common.applocation.is_win')
|
||||
@patch('openlp.core.common.applocation.is_macosx')
|
||||
@patch('openlp.core.common.applocation.AppDirs')
|
||||
@patch('openlp.core.common.applocation.PlatformDirs')
|
||||
@patch('openlp.core.common.applocation.Path.exists', autospec=True)
|
||||
def test_get_directory_for_language_dir_from_linux(mocked_exists, MockAppDirs, mocked_is_macosx, mocked_is_win,
|
||||
def test_get_directory_for_language_dir_from_linux(mocked_exists, MockPlatformDirs, mocked_is_macosx, mocked_is_win,
|
||||
mocked_resolve):
|
||||
"""
|
||||
Test the AppLocation.get_directory() method for AppLocation.LanguageDir
|
||||
|
@ -240,7 +240,7 @@ def test_get_directory_for_language_dir_from_linux(mocked_exists, MockAppDirs, m
|
|||
mocked_is_macosx.return_value = False
|
||||
candidate_dirs = ['/usr/share/gnome/openlp', '/usr/local/share/openlp', '/usr/share/openlp']
|
||||
mocked_dirs = MagicMock(site_data_dir=os.pathsep.join(candidate_dirs))
|
||||
MockAppDirs.return_value = mocked_dirs
|
||||
MockPlatformDirs.return_value = mocked_dirs
|
||||
mocked_exists.side_effect = lambda p: p in candidate_dirs + [openlp_i18n_path]
|
||||
|
||||
# WHEN: We call AppLocation.get_directory
|
||||
|
|
Loading…
Reference in New Issue