déplacement de valeur vers des constantes et config mypy vscode
This commit is contained in:
13
.vscode/settings.json
vendored
13
.vscode/settings.json
vendored
@@ -1,6 +1,15 @@
|
|||||||
{
|
{
|
||||||
"python.analysis.autoImportCompletions": true,
|
"python.analysis.autoImportCompletions": true,
|
||||||
"python.analysis.extraPaths": [".venv/lib/python3.11/site-packages"],
|
"python.analysis.extraPaths": [".venv/lib/site-packages"],
|
||||||
"python.analysis.fixAll": ["source.unusedImports"],
|
"python.analysis.fixAll": ["source.unusedImports"],
|
||||||
"python.languageServer": "Pylance"
|
"python.languageServer": "Pylance",
|
||||||
|
"mypy-type-checker.args": [
|
||||||
|
"--disallow-untyped-defs=True",
|
||||||
|
"--disallow-untyped-calls=True",
|
||||||
|
"--check-untyped-defs=True",
|
||||||
|
"--warn_return_any=True",
|
||||||
|
"--no-implicit-optional=True",
|
||||||
|
"--strict_optional=True",
|
||||||
|
"--ignore_missing_imports=True",
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,11 +8,12 @@ URLS = {
|
|||||||
"intranet": "https://la-taniere.fun/connexion/",
|
"intranet": "https://la-taniere.fun/connexion/",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RESOURCES_MP3 = ":/assets/the-beat-of-nature.mp3"
|
||||||
|
RESOURCES_FONT = ":/assets/fonts/Roboto-Regular.ttf"
|
||||||
|
|
||||||
GLOW_COLOR = QColor(255, 140, 0, 255)
|
GLOW_COLOR = QColor(255, 140, 0, 255)
|
||||||
GLOW_BLUR_BASE = 15
|
GLOW_BLUR_BASE = 15
|
||||||
GLOW_BLUR_PEAK = 70
|
GLOW_BLUR_PEAK = 70
|
||||||
GLOW_ANIM_DURATION = 1200
|
GLOW_ANIM_DURATION = 1200
|
||||||
|
|
||||||
MP3_PATH = ":/assets/the-beat-of-nature.mp3"
|
|
||||||
|
|
||||||
NO_STAFF = True
|
NO_STAFF = True
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from PySide6.QtMultimedia import QMediaPlayer, QAudioOutput
|
|||||||
|
|
||||||
from config.config_manager import ConfigManager, VOLUME_KEY
|
from config.config_manager import ConfigManager, VOLUME_KEY
|
||||||
|
|
||||||
from constants import MP3_PATH
|
from constants import RESOURCES_MP3
|
||||||
|
|
||||||
class AudioController:
|
class AudioController:
|
||||||
# Encapsule toute la logique audio : lecture, volume, mute.
|
# Encapsule toute la logique audio : lecture, volume, mute.
|
||||||
@@ -20,7 +20,7 @@ class AudioController:
|
|||||||
self._player.setLoops(-1)
|
self._player.setLoops(-1)
|
||||||
|
|
||||||
# Chargement du MP3 depuis les ressources Qt
|
# Chargement du MP3 depuis les ressources Qt
|
||||||
mp3file = QFile(MP3_PATH)
|
mp3file = QFile(RESOURCES_MP3)
|
||||||
mp3file.open(QFile.ReadOnly)
|
mp3file.open(QFile.ReadOnly)
|
||||||
mp3data = mp3file.readAll()
|
mp3data = mp3file.readAll()
|
||||||
mp3file.close()
|
mp3file.close()
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ from PySide6.QtCore import QResource
|
|||||||
from PySide6.QtGui import QFontDatabase, QFont
|
from PySide6.QtGui import QFontDatabase, QFont
|
||||||
from PySide6.QtWidgets import QApplication
|
from PySide6.QtWidgets import QApplication
|
||||||
|
|
||||||
import resources as resources # noqa: F401
|
import resources as resources
|
||||||
|
|
||||||
from ui.main_window import MainWindow
|
from ui.main_window import MainWindow
|
||||||
|
from constants import RESOURCES_FONT
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Bundle path resolution
|
# Bundle path resolution
|
||||||
@@ -27,7 +27,7 @@ QResource.registerResource(f"{bundle_dir}/resources.py")
|
|||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
def load_custom_font() -> str:
|
def load_custom_font() -> str:
|
||||||
font_id = QFontDatabase.addApplicationFont(":/assets/Avocado-Cake-Demo.otf")
|
font_id = QFontDatabase.addApplicationFont(RESOURCES_FONT)
|
||||||
if font_id == -1:
|
if font_id == -1:
|
||||||
raise RuntimeError("Failed to load font from resources.")
|
raise RuntimeError("Failed to load font from resources.")
|
||||||
font_families = QFontDatabase.applicationFontFamilies(font_id)
|
font_families = QFontDatabase.applicationFontFamilies(font_id)
|
||||||
|
|||||||
Reference in New Issue
Block a user