Hotfix/Splashscreen Staying up on Windows installer (#4232)

* fixes splashscreen not disappearing in windows installer

* replace it all together

* Update settings_logger.py
This commit is contained in:
teh_coderer
2023-02-14 08:19:34 -06:00
committed by GitHub
parent fca7ec36ac
commit cd5cb61344
3 changed files with 11 additions and 25 deletions

View File

@@ -9,7 +9,7 @@ from types import FunctionType, ModuleType
import openbb_terminal.feature_flags as obbff
from openbb_terminal import config_terminal as cfg
from openbb_terminal.core.log.generation.common import do_rollover
from openbb_terminal.terminal_helper import is_packaged_application
from openbb_terminal.terminal_helper import is_installer
SENSITIVE_WORDS = [
"API",
@@ -54,7 +54,7 @@ def log_settings() -> None:
settings_dict["watermark"] = "True" if obbff.USE_WATERMARK else "False"
settings_dict["autoscaling"] = "True" if obbff.USE_PLOT_AUTOSCALING else "False"
settings_dict["dt"] = "True" if obbff.USE_DATETIME else "False"
settings_dict["packaged"] = "True" if is_packaged_application() else "False"
settings_dict["packaged"] = "True" if is_installer() else "False"
settings_dict["python"] = str(platform.python_version())
settings_dict["os"] = str(platform.system())

View File

@@ -51,7 +51,7 @@ from openbb_terminal.terminal_helper import (
bootup,
check_for_updates,
is_auth_enabled,
is_packaged_application,
is_installer,
is_reset,
print_goodbye,
reset,
@@ -67,7 +67,7 @@ logger = logging.getLogger(__name__)
env_file = str(USER_ENV_FILE)
if is_packaged_application():
if is_installer():
# Necessary for installer so that it can locate the correct certificates for
# API calls and https
# https://stackoverflow.com/questions/27835619/urllib-and-ssl-certificate-verify-failed-error/73270162#73270162
@@ -166,7 +166,7 @@ class TerminalController(BaseController):
mt.add_cmd("about")
mt.add_cmd("support")
mt.add_cmd("survey")
if not is_packaged_application():
if not is_installer():
mt.add_cmd("update")
mt.add_cmd("wiki")
mt.add_cmd("news")
@@ -356,7 +356,7 @@ class TerminalController(BaseController):
def call_update(self, _):
"""Process update command."""
if not is_packaged_application():
if not is_installer():
self.update_success = not update_terminal()
else:
console.print(
@@ -429,7 +429,7 @@ class TerminalController(BaseController):
def call_dashboards(self, _):
"""Process dashboards command."""
if not is_packaged_application():
if not is_installer():
from openbb_terminal.dashboards.dashboards_controller import (
DashboardsController,
)

View File

@@ -21,7 +21,7 @@ from openbb_terminal import (
)
# IMPORTATION INTERNAL
from openbb_terminal.config_terminal import LOGGING_APP_NAME, LOGGING_COMMIT_HASH
from openbb_terminal.config_terminal import LOGGING_COMMIT_HASH
from openbb_terminal.helper_funcs import request
from openbb_terminal.rich_config import console
from openbb_terminal.session.user import User
@@ -219,17 +219,6 @@ def hide_splashscreen():
logger.info(e)
def is_packaged_application() -> bool:
"""Tell whether or not it is a packaged version (Windows or Mac installer).
Returns:
bool: If the application is packaged
"""
return LOGGING_APP_NAME == "gst_packaged"
def is_auth_enabled() -> bool:
"""Tell whether or not authentication is enabled.
@@ -246,11 +235,8 @@ def is_auth_enabled() -> bool:
def is_installer() -> bool:
"""Tell whether or not it is a packaged version."""
# TODO: Merge this with is_packaged_application
if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"):
return True
return False
"""Tell whether or not it is a packaged version (Windows or Mac installer"""
return getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS")
def bootup():
@@ -258,7 +244,7 @@ def bootup():
# Enable VT100 Escape Sequence for WINDOWS 10 Ver. 1607
os.system("") # nosec
# Hide splashscreen loader of the packaged app
if is_packaged_application():
if is_installer():
hide_splashscreen()
try: