From a2ecbe9bfe79a56a1ff4979a1f4a3cb0d5673f3b Mon Sep 17 00:00:00 2001 From: "didierlopes.eth" Date: Thu, 12 May 2022 02:51:29 +0100 Subject: [PATCH] Improve overall UX (#1804) * Improve overall UX * follow Andrew suggestion * improve versioning modified Co-authored-by: James Maslek --- openbb_terminal/feature_flags.py | 2 +- openbb_terminal/rich_config.py | 2 +- openbb_terminal/terminal_helper.py | 48 +++++++++++++----------------- terminal.py | 3 +- 4 files changed, 24 insertions(+), 31 deletions(-) diff --git a/openbb_terminal/feature_flags.py b/openbb_terminal/feature_flags.py index a51ef2bed59..e128d2276fc 100644 --- a/openbb_terminal/feature_flags.py +++ b/openbb_terminal/feature_flags.py @@ -83,5 +83,5 @@ LOGGING_COMMIT_HASH = str(os.getenv("OPENBB_LOGGING_COMMIT_HASH", "REPLACE_ME")) try: version = pkg_resources.get_distribution("OpenBBTerminal").version except Exception: - version = "REPLACE_ME" + version = "1.2.1m" VERSION = str(os.getenv("OPENBB_VERSION", version)) diff --git a/openbb_terminal/rich_config.py b/openbb_terminal/rich_config.py index 85662430c56..c3fd37bbbae 100644 --- a/openbb_terminal/rich_config.py +++ b/openbb_terminal/rich_config.py @@ -60,7 +60,7 @@ class ConsoleAndPanel: kwargs["text"], title=kwargs["menu"], subtitle_align="right", - subtitle="OpenBB Terminal", + subtitle=f"OpenBB Terminal v{obbff.VERSION} (https://openbb.co)", ) ) else: diff --git a/openbb_terminal/terminal_helper.py b/openbb_terminal/terminal_helper.py index 8db05f58be1..1480ad76f02 100644 --- a/openbb_terminal/terminal_helper.py +++ b/openbb_terminal/terminal_helper.py @@ -6,10 +6,8 @@ from contextlib import contextmanager import hashlib import logging import os -import random import subprocess # nosec import sys -from datetime import datetime from typing import List # IMPORTATION THIRDPARTY @@ -33,31 +31,23 @@ logger = logging.getLogger(__name__) def print_goodbye(): """Prints a goodbye message when quitting the terminal""" - goodbye_msg = [ - "An informed ape, is a strong ape. ", - "Remember that stonks only go up. ", - "Diamond hands. ", - "Apes together strong. ", - "This is our way. ", - "Keep the spacesuit ape, we haven't reached the moon yet. ", - "I am not a cat. I'm an ape. ", - "We like the terminal. ", - ] + # LEGACY GOODBYE MESSAGES - You'll live in our hearts forever. + # "An informed ape, is a strong ape." + # "Remember that stonks only go up." + # "Diamond hands." + # "Apes together strong." + # "This is our way." + # "Keep the spacesuit ape, we haven't reached the moon yet." + # "I am not a cat. I'm an ape." + # "We like the terminal." + # "...when offered a flight to the moon, nobody asks about what seat." - goodbye_hr = datetime.now().hour - if goodbye_hr < 5: - goodbye_msg_time = "Go get some rest soldier!" - elif goodbye_hr < 11: - goodbye_msg_time = "Rise and shine baby!" - elif goodbye_hr < 17: - goodbye_msg_time = "Enjoy your day!" - elif goodbye_hr < 23: - goodbye_msg_time = "Tomorrow's another day!" - else: - goodbye_msg_time = "Go get some rest soldier!" - - console.print( # nosec - goodbye_msg[random.randint(0, len(goodbye_msg) - 1)] + goodbye_msg_time + "\n" + console.print( + "OpenBB Terminal is the result of a strong community building an " + "[param]investment research platform for everyone.[/param]\n\n" + "Join us on [cmds]https://discord.gg/Up2QGbMKHY[/cmds], " + "show your appreciation on [cmds]https://twitter.com/openbb_finance,[/cmds]\n" + "or even request a feature on [cmds]https://openbb.co/request-a-feature[/cmds]\n" ) logger.info("END") @@ -111,9 +101,11 @@ def about_us(): console.print( "\n[green]Thanks for using OpenBB Terminal. This is our way![/green]\n" + "\n" + + "[cyan]Website: [/cyan]https://openbb.co\n" + + "[cyan]Documentation: [/cyan]https://openbb-finance.github.io/OpenBBTerminal/\n" + + "\n" + "[cyan]Join our community on discord: [/cyan]https://discord.gg/Up2QGbMKHY\n" + "[cyan]Follow our twitter for updates: [/cyan]https://twitter.com/openbb_finance\n" - + "[cyan]Access our landing page: [/cyan]https://openbb-finance.github.io/OpenBBTerminal/\n" + "\n" + "[yellow]Partnerships:[/yellow]\n" + "[cyan]FinBrain: [/cyan]https://finbrain.tech\n" @@ -170,7 +162,7 @@ def bootup(): def welcome_message(): # Print first welcome message and help - console.print(f"\nWelcome to OpenBB Terminal v{obbff.VERSION}\n") + console.print(f"\nWelcome to OpenBB Terminal v{obbff.VERSION}") # The commit has was commented out because the terminal was crashing due to git import for multiple users # ({str(git.Repo('.').head.commit)[:7]}) diff --git a/terminal.py b/terminal.py index a22c644ee01..a0b5e6322e9 100644 --- a/terminal.py +++ b/terminal.py @@ -99,7 +99,8 @@ class TerminalController(BaseController): console.print( # nosec text=f""" [info]Get API keys from data providers to access more features.[/info] - For more instructions use: 'keys' + For more instructions use: 'keys'. + To see all features follow: https://openbb-finance.github.io/OpenBBTerminal/ [info]Multiple jobs queue (where each '/' denotes a new command).[/info] E.g. '/stocks $ disc/ugs -n 3/../load tsla/candle'