mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-07-29 07:03:47 +00:00
refactor Paths and update build workflow
+ rename app_dir -> config_dir and config_dir to config_parent + bundle web client as zip + bundle and extract client zip when running pyinstaller builds + installer pyinstaller as main dependency + remove fallback client flag + handle already used port + add assethandler class + remove some startup logs + ignore wheels and client.zip files
This commit is contained in:
@@ -1,16 +1,24 @@
|
||||
# Launcher script
|
||||
import swingmusic.__main__ as app
|
||||
import sys
|
||||
import zipfile
|
||||
import multiprocessing
|
||||
from pathlib import Path
|
||||
import swingmusic.__main__ as app
|
||||
|
||||
if __name__ == "__main__":
|
||||
# this entry should only be used by pyinstaller.
|
||||
# add freeze support here as pyinstaller uses this entry only
|
||||
# add freeze support here as pyinstaller uses this entry
|
||||
|
||||
if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'):
|
||||
client = sys._MEIPASS + "/client"
|
||||
sys.argv.extend(["--fallback-client", client])
|
||||
sys.orig_argv.extend(["--fallback-client", client])
|
||||
if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"):
|
||||
# INFO: extract client.zip to sys._MEIPASS
|
||||
with zipfile.ZipFile(sys._MEIPASS + "/client.zip", "r") as zip_ref:
|
||||
zip_ref.extractall(sys._MEIPASS)
|
||||
|
||||
client = Path(sys._MEIPASS) / "client"
|
||||
client_str = str(client)
|
||||
|
||||
sys.argv.extend(["--client", client_str])
|
||||
sys.orig_argv.extend(["--client", client_str])
|
||||
|
||||
multiprocessing.freeze_support()
|
||||
app.run()
|
||||
|
||||
Reference in New Issue
Block a user