Skip to content

Commit

Permalink
Merge branch 'feature/james-didier-feedback' of github.com:OpenBB-fin…
Browse files Browse the repository at this point in the history
…ance/OpenBBTerminal into feature/james-didier-feedback
  • Loading branch information
hjoaquim committed May 10, 2024
2 parents b9b485d + aa53005 commit b960c16
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 21 deletions.
18 changes: 4 additions & 14 deletions cli/openbb_cli/controllers/base_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,14 +496,7 @@ def call_record(self, other_args) -> None:
help="Whether the routine should be public or not",
default=False,
)
parser.add_argument(
"-l",
"--local",
dest="local",
action="store_true",
help="Only save the routine locally - this is necessary if you are running in guest mode.",
default=False,
)

if other_args and "-" not in other_args[0][0]:
other_args.insert(0, "-n")

Expand Down Expand Up @@ -549,17 +542,16 @@ def call_record(self, other_args) -> None:
)
return

if session.is_local() and not ns_parser.local:
if session.is_local():
session.console.print(
"[red]Recording session to the OpenBB Hub is not supported in guest mode.[/red]"
)
session.console.print(
"\n[yellow]Sign to OpenBB Hub to register: http://my.openbb.co[/yellow]"
"\n[yellow]Visit the OpenBB Hub to register: http://my.openbb.co[/yellow]"
)
session.console.print(
"\n[yellow]Otherwise set the flag '-l' to save the file locally.[/yellow]"
"\n[yellow]Your routine will be saved locally.[/yellow]\n"
)
return

# Check if title has a valid format
title = " ".join(ns_parser.name) if ns_parser.name else ""
Expand All @@ -571,14 +563,12 @@ def call_record(self, other_args) -> None:
return

global RECORD_SESSION # noqa: PLW0603
global RECORD_SESSION_LOCAL_ONLY # noqa: PLW0603
global SESSION_RECORDED_NAME # noqa: PLW0603
global SESSION_RECORDED_DESCRIPTION # noqa: PLW0603
global SESSION_RECORDED_TAGS # noqa: PLW0603
global SESSION_RECORDED_PUBLIC # noqa: PLW0603

RECORD_SESSION = True
RECORD_SESSION_LOCAL_ONLY = ns_parser.local
SESSION_RECORDED_NAME = title
SESSION_RECORDED_DESCRIPTION = (
" ".join(ns_parser.description)
Expand Down
8 changes: 3 additions & 5 deletions cli/openbb_cli/controllers/cli_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,10 @@ def print_help(self):
mt.add_cmd("results")
if session.obbject_registry.obbjects:
mt.add_section("Cached Results:\n", leading_new_line=True)
for key, value in list(session.obbject_registry.all.items())[
for key, value in list(session.obbject_registry.all.items())[ # type: ignore
: session.settings.N_TO_DISPLAY_OBBJECT_REGISTRY
]:
mt.add_raw(f"\tOBB{key}: {value['command']}\n")
mt.add_raw(f"\tOBB{key}: {value['command']}\n") # type: ignore

session.console.print(text=mt.menu_text, menu="Home")
self.update_runtime_choices()
Expand Down Expand Up @@ -533,9 +533,7 @@ def run_cli(jobs_cmds: Optional[List[str]] = None, test_mode=False):

if first_time_user():
with contextlib.suppress(EOFError):
webbrowser.open(
"https://docs.openbb.co/terminal/usage/overview/structure-and-navigation"
)
webbrowser.open("https://docs.openbb.co/cli")

t_controller.print_help()

Expand Down
6 changes: 4 additions & 2 deletions cli/openbb_cli/controllers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ def print_goodbye():
text = """
[param]Thank you for using the OpenBB Platform CLI and being part of this journey.[/param]
We hope you'll find the new CLI as valuable as this. To stay tuned, sign up for our newsletter: [cmds]https://openbb.co/newsletter.[/]
We hope you'll find the new OpenBB Platform CLI a valuable tool.
In the meantime, check out our other products:
To stay tuned, sign up for our newsletter: [cmds]https://openbb.co/newsletter.[/]
Please feel free to check out our other products:
[bold]OpenBB Terminal Pro[/]: [cmds]https://openbb.co/products/pro[/cmds]
[bold]OpenBB Platform:[/] [cmds]https://openbb.co/products/platform[/cmds]
Expand Down

0 comments on commit b960c16

Please sign in to comment.