- main.py: titolo finestra pywebview -> 'MusicTools' - core/config.py: APP_NAME='MusicTools', cartella config bundled ora ~/Library/Application Support/MusicTools/ e %APPDATA%/MusicTools/. Migrazione one-shot: se non esiste la nuova ma esiste la legacy 'MusicDownload', il config.json viene copiato cosi' le impostazioni non vanno perse dopo l'aggiornamento - core/recorder.py: messaggio errore permesso microfono - api/bridge.py: User-Agent update check + guida Spotify menzionano MusicTools - build_macos.py / build_windows.py / .github/workflows/build.yml: prodotti rinominati (MusicTools.app, MusicTools.exe, MusicTools-macOS.zip, MusicTools-Windows.zip, Release 'Build MusicTools') - webui: <title>, brand-name sidebar, intestazioni commenti - README: tutti i riferimenti aggiornati + nota che il repo Git conserva il nome storico 'musicdownload' (URL stabili per release gia' pubblicate) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
43 lines
941 B
Python
43 lines
941 B
Python
"""MusicTools — Entry point (pywebview + WebKit/EdgeChromium)."""
|
|
|
|
import os
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
import webview
|
|
|
|
from api.bridge import Api
|
|
|
|
|
|
def _resource_path(*parts) -> str:
|
|
"""Trova il path di una risorsa sia in dev che bundled (PyInstaller)."""
|
|
if getattr(sys, "frozen", False):
|
|
base = Path(sys._MEIPASS) # type: ignore[attr-defined]
|
|
else:
|
|
base = Path(__file__).resolve().parent
|
|
return str(base.joinpath(*parts))
|
|
|
|
|
|
def main():
|
|
api = Api()
|
|
index_path = _resource_path("webui", "index.html")
|
|
|
|
window = webview.create_window(
|
|
title="MusicTools",
|
|
url=index_path,
|
|
js_api=api,
|
|
width=1080,
|
|
height=720,
|
|
min_size=(900, 600),
|
|
background_color="#0A0A0A",
|
|
resizable=True,
|
|
)
|
|
api.window = window
|
|
|
|
# Disable native menu / set dark on macOS
|
|
webview.start(debug=False)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|