Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exe --file choices on login #4799

Merged
merged 4 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions openbb_terminal/core/session/session_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from openbb_terminal.core.session.utils import run_thread
from openbb_terminal.helper_funcs import system_clear
from openbb_terminal.loggers import setup_logging
from openbb_terminal.rich_config import console
from openbb_terminal.rich_config import console, optional_rich_track

# pylint: disable=consider-using-f-string

Expand Down Expand Up @@ -105,7 +105,7 @@ def login(session: dict) -> LoginStatus:
set_current_user(hub_user)

auth_header = hub_user.profile.get_auth_header()
run_thread(download_and_save_routines, {"auth_header": auth_header})
download_and_save_routines(auth_header)
run_thread(
update_backend_sources, {"auth_header": auth_header, "configs": configs}
)
Expand All @@ -119,21 +119,23 @@ def login(session: dict) -> LoginStatus:
return LoginStatus.NO_RESPONSE


def download_and_save_routines(auth_header: str, silent: bool = True):
def download_and_save_routines(auth_header: str):
"""Download and save routines.

Parameters
----------
auth_header : str
The authorization header, e.g. "Bearer <token>".
silent : bool
Whether to silence the console output, by default True
"""
routines = download_routines(auth_header=auth_header, silent=silent)
for name, content in routines.items():
save_routine(
file_name=f"{name}.openbb", routine=content, force=True, silent=silent
)
try:
console.print("Downloading routines...")
routines = download_routines(auth_header=auth_header)
for name, content in optional_rich_track(
routines.items(), desc="Saving routines"
):
save_routine(file_name=f"{name}.openbb", routine=content, force=True)
except Exception:
console.print("[red]Failed to download and save routines.[/red]")


def update_backend_sources(auth_header, configs, silent: bool = True):
Expand Down
4 changes: 4 additions & 0 deletions website/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -445,3 +445,7 @@ details summary {
[data-theme="dark"] #__docusaurus {
background-color: #131313ff !important;
}

.main-wrapper main {
min-height: 1000px !important;
}