diff --git a/assets/logo.png b/assets/logo.png new file mode 100644 index 0000000..c07f9f7 Binary files /dev/null and b/assets/logo.png differ diff --git a/install.py b/install.py new file mode 100644 index 0000000..75a7fed --- /dev/null +++ b/install.py @@ -0,0 +1,57 @@ +import os +import sys + +_all_ = [ + "PyQt6>=6.10.2", + "PyQt6-Qt6>=6.10.2", + "PyQt6_sip>=13.11.0", + "PySide6>=6.10.2", + "PySide6_Addons>=6.10.2", + "PySide6_Essentials>=6.10.2", + "shiboken6>=6.10.2", +] + +windows = [ + "typing_extensions>=4.15.0", + "win11toast>=0.36.3", + "winrt-runtime>=3.2.1", + "winrt-Windows.Data.Xml.Dom>=3.2.1", + "winrt-Windows.Foundation>=3.2.1", + "winrt-Windows.Foundation.Collections>=3.2.1", + "winrt-Windows.Globalization>=3.2.1", + "winrt-Windows.Graphics.Imaging>=3.2.1", + "winrt-Windows.Media.Core>=3.2.1", + "winrt-Windows.Media.Ocr>=3.2.1", + "winrt-Windows.Media.Playback>=3.2.1", + "winrt-Windows.Media.SpeechSynthesis>=3.2.1", + "winrt-Windows.Storage>=3.2.1", + "winrt-Windows.Storage.Streams>=3.2.1", + "winrt-Windows.UI.Notifications>=3.2.1", +] + +linux = [] # type: list[str] + +darwin = [] # type: list[str] + +def install(packages): + for package in packages: + os.system(f'python3 -m pip install "{package}"') + +if __name__ == "__main__": + + from sys import platform + + if hasattr(sys, 'real_prefix') or (hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix): + print("Inside venv") + else: + print("Not in venv, quit.") + sys.exit() + + install(_all_) + if platform== 'windows': + install(windows) + if platform.startswith('linux'): + install(linux) + if platform == 'darwin': # MacOs + install(darwin) + diff --git a/readme.md b/readme.md index 3893444..ff3ccd6 100644 --- a/readme.md +++ b/readme.md @@ -1,9 +1,38 @@ # LaTaniere Launcher UI -### First: create virtualenv +## First: create virtualenv python -m venv .venv -### Second: install packages -pip install -r .\requirements.txt +## Second: activate your virtual environment +### Windows +Execute in powershell: +``` +.venv/bin/activate.ps1 +``` +or batch file +``` +.venv/bin/activate.bat +``` + +### Linux +Execute into terminal in project folder: +`source .venv/bin/actiave` + +---- + +## Third install packages +Ensure your virtual environment is active and execute these commands within it. + +### Using Pip +#### Global packages +`pip install -r .\requirements.txt` + +#### packages for Windows only +`pip install -r .\windows_requirements.txt` + +### Using install.py script +Execute `python install.py` +Note: in case if you aren't virtual environment, the script stop. + Enjoy. diff --git a/requirements.txt b/requirements.txt index 2aa0d21..44ac27e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,18 +5,3 @@ PySide6==6.10.2 PySide6_Addons==6.10.2 PySide6_Essentials==6.10.2 shiboken6==6.10.2 -typing_extensions==4.15.0 -win11toast==0.36.3 -winrt-runtime==3.2.1 -winrt-Windows.Data.Xml.Dom==3.2.1 -winrt-Windows.Foundation==3.2.1 -winrt-Windows.Foundation.Collections==3.2.1 -winrt-Windows.Globalization==3.2.1 -winrt-Windows.Graphics.Imaging==3.2.1 -winrt-Windows.Media.Core==3.2.1 -winrt-Windows.Media.Ocr==3.2.1 -winrt-Windows.Media.Playback==3.2.1 -winrt-Windows.Media.SpeechSynthesis==3.2.1 -winrt-Windows.Storage==3.2.1 -winrt-Windows.Storage.Streams==3.2.1 -winrt-Windows.UI.Notifications==3.2.1 diff --git a/src/mainwindow.py b/src/mainwindow.py index a08b656..4282a83 100644 --- a/src/mainwindow.py +++ b/src/mainwindow.py @@ -6,8 +6,6 @@ from PyQt6.QtCore import Qt from PyQt6.QtGui import QFontDatabase, QFont, QColor from PyQt6.QtWidgets import QApplication, QMainWindow -from win11toast import toast, notify - # Compile resources.qrc into resources_rc.py # rcc -g python resources.qrc -o resources_rc.py @@ -17,6 +15,9 @@ import resources as resources # This is generated from the .qrc file # noqa: if sys.platform.startswith('linux'): os.environ["QT_QPA_PLATFORM"] = "xcb" +if sys.platform=='windows': + from win11toast import toast, notify + # Remove this into final release from fake_patch_notes import patch_note NO_STAFF = True @@ -103,7 +104,8 @@ class MainWindow(QMainWindow): buttons = [ {'activationType': 'protocol', 'arguments': '', 'content': 'Entrer en jeu'}, ] - toast('C\'est enfin à ton tour d\'entrer en jeu! 🎮🐍', app_id='LaTanière Launcher',buttons=buttons) + if sys.platform=='windows': + toast('C\'est enfin à ton tour d\'entrer en jeu! 🎮🐍', app_id='LaTanière Launcher',buttons=buttons) if __name__ == "__main__": diff --git a/windows_requirements.txt b/windows_requirements.txt new file mode 100644 index 0000000..e27d1ef --- /dev/null +++ b/windows_requirements.txt @@ -0,0 +1,15 @@ +typing_extensions==4.15.0 +win11toast==0.36.3 +winrt-runtime==3.2.1 +winrt-Windows.Data.Xml.Dom==3.2.1 +winrt-Windows.Foundation==3.2.1 +winrt-Windows.Foundation.Collections==3.2.1 +winrt-Windows.Globalization==3.2.1 +winrt-Windows.Graphics.Imaging==3.2.1 +winrt-Windows.Media.Core==3.2.1 +winrt-Windows.Media.Ocr==3.2.1 +winrt-Windows.Media.Playback==3.2.1 +winrt-Windows.Media.SpeechSynthesis==3.2.1 +winrt-Windows.Storage==3.2.1 +winrt-Windows.Storage.Streams==3.2.1 +winrt-Windows.UI.Notifications==3.2.1