adding splash screen support to terminal.spec and terminal.py

This commit is contained in:
Andrew
2022-03-22 12:01:34 -04:00
parent c7a3cb9e84
commit d5364e98f6
4 changed files with 29 additions and 29 deletions

View File

@@ -1,14 +0,0 @@
channels:
- conda-forge
- defaults
dependencies:
- python=3.8
- pip
- poetry=1.1.12
- numpy=1.21.2
- cvxpy=1.2.0
- pytest
- black=22.1.0
- sphinx=4.1.1
- charset-normalizer=2.0.12
- rich=10.16.2

View File

@@ -1,14 +0,0 @@
channels:
- conda-forge
- defaults
dependencies:
- python=3.8
- pip
- poetry=1.1.12
- numpy=1.21.2
- cvxpy=1.2.0
- pytest
- black=22.1.0
- sphinx=4.1.1
- charset-normalizer=2.0.12
- rich=10.16.2

View File

@@ -48,15 +48,23 @@ a = Analysis(
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
splash = Splash('../../images/splashscreen.png',
binaries=a.binaries,
datas=a.datas,
text_pos=(200, 400),
text_size=12,
text_color='black')
exe = EXE(
pyz,
a.scripts,
splash,
splash.binaries,
a.binaries,
a.zipfiles,
a.datas,
[],
name="terminal",
name="GameStonk",
debug=False,
bootloader_ignore_signals=False,
strip=False,
@@ -68,6 +76,7 @@ exe = EXE(
target_arch="x86_64",
codesign_identity=None,
entitlements_file=None,
icon = "../../images/gst_app.ico",
)

View File

@@ -39,6 +39,25 @@ from gamestonk_terminal.terminal_helper import (
welcome_message,
)
# This imports the package needed for the installer - Wrapped in try/except because
# it's not needed on the normal launch of project.
try:
import pyi_splash
except:
pass
# Below line tells the splash screen to go away on .exe launch when terminal is loaded.
try:
# Update the text on the splash screen
pyi_splash.update_text("Terminal Loaded!")
# Close the splash screen. It does not matter when the call
# to this function is made, the splash screen remains open until
# this function is called or the Python program is terminated.
pyi_splash.close()
except Exception as e:
print(e)
pass
# pylint: disable=too-many-public-methods,import-outside-toplevel,too-many-branches
logger = logging.getLogger(__name__)