Files
OpenBB/terminal.py
montezdesousa 3d243b361a Sync with hub on reset + routines fixes (#4842)
* keep session alive on reset

* remove print

* silence routines

* ruff

* skip login if is papermill

* ruff

* move is_papermill to avoid prompt_toolkit warning fd is not a terminal

* move is_papermill back and check for atty instead

* only download routines and update sources if terminal

* only starts prompt toolkit if isatty

* black

* avoid duplicate files after reset/login

* remove hub  routines on reset

* comment

* fix unittest

* forgot this debugging prints
2023-04-21 16:12:09 +00:00

45 lines
1.1 KiB
Python

import sys
from multiprocessing import freeze_support
import openbb_terminal.config_terminal as cfg
# pylint:disable=unused-import,import-outside-toplevel
import openbb_terminal.core.session.current_system as syst # noqa: F401
from openbb_terminal.terminal_helper import (
hide_splashscreen,
is_auth_enabled,
is_installer,
)
def main():
sent_args = sys.argv[1:]
cfg.setup_config_terminal()
if "--streamlit" in sent_args:
from openbb_terminal.dashboards import streamlit
hide_splashscreen()
sys.exit(streamlit.main())
if "-t" in sent_args or "--test" in sent_args:
from openbb_terminal.core.integration_tests import integration_controller
integration_controller.main()
else:
from openbb_terminal.core.session import session_controller
if (
is_auth_enabled()
and ("--login" in sys.argv[1:] or is_installer())
and sys.stdin.isatty()
):
session_controller.main()
else:
session_controller.launch_terminal()
if __name__ == "__main__":
freeze_support()
main()