Adapting for windows and linux

This commit is contained in:
2026-03-05 14:08:33 +01:00
parent 8395b2f220
commit a4bcd764db
6 changed files with 109 additions and 21 deletions

BIN
assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

57
install.py Normal file
View File

@@ -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)

View File

@@ -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.

View File

@@ -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

View File

@@ -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__":

15
windows_requirements.txt Normal file
View File

@@ -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