Skip to content

Commit

Permalink
Add version featflag (#4487)
Browse files Browse the repository at this point in the history
* Add version featflag

* Small mistake, ta also complained
  • Loading branch information
JerBouma authored Mar 15, 2023
1 parent 452ecd1 commit 46fcf9c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions openbb_terminal/core/models/preferences_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class PreferencesModel:
# FEATURE FLAGS
SYNC_ENABLED: bool = True
FILE_OVERWRITE: bool = False
SHOW_VERSION: bool = True
RETRY_WITH_LOAD: bool = False
USE_TABULATE_DF: bool = True
# Use interactive window to display dataframes with options to sort, filter, etc.
Expand Down
6 changes: 6 additions & 0 deletions openbb_terminal/featflags_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class FeatureFlagsController(BaseController):
"richpanel",
"tbhint",
"overwrite",
"version",
]
PATH = "/featflags/"

Expand Down Expand Up @@ -76,6 +77,7 @@ def print_help(self):
mt.add_setting("cmdloc", current_user.preferences.USE_CMD_LOCATION_FIGURE)
mt.add_setting("tbhint", current_user.preferences.TOOLBAR_HINT)
mt.add_setting("overwrite", current_user.preferences.FILE_OVERWRITE)
mt.add_setting("version", current_user.preferences.SHOW_VERSION)

console.print(text=mt.menu_text, menu="Feature Flags")

Expand All @@ -85,6 +87,10 @@ def call_overwrite(self, _):
"FILE_OVERWITE", not get_current_user().preferences.FILE_OVERWRITE
)

def call_version(self, _):
"""Process version command"""
set_preference("SHOW_VERSION", not get_current_user().preferences.SHOW_VERSION)

def call_retryload(self, _):
"""Process retryload command"""
set_preference(
Expand Down
2 changes: 2 additions & 0 deletions openbb_terminal/miscellaneous/i18n/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ en:
featflags/ion: interactive matplotlib mode
featflags/watermark: watermark in figures
featflags/cmdloc: command location displayed in figures
featflags/overwrite: whether to overwrite Excel files if they already exists
featflags/version: whether to show the version in the bottom right corner
featflags/tbhint: displays usage hints in the bottom toolbar
settings/_info_: Settings through environment variables
settings/colors: set your own terminal colors
Expand Down
5 changes: 4 additions & 1 deletion openbb_terminal/rich_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,10 @@ def print(self, *args, **kwargs):
if kwargs and "text" in list(kwargs) and "menu" in list(kwargs):
if not os.getenv("TEST_MODE"):
if current_user.preferences.ENABLE_RICH_PANEL:
version = f"[param]OpenBB Terminal v{cfg.VERSION}[/param] (https://openbb.co)"
if current_user.preferences.SHOW_VERSION:
version = f"[param]OpenBB Terminal v{cfg.VERSION}[/param] (https://openbb.co)"
else:
version = "[param]OpenBB Terminal[/param] (https://openbb.co)"
self.console.print(
panel.Panel(
"\n" + kwargs["text"],
Expand Down
2 changes: 1 addition & 1 deletion openbb_terminal/stocks/technical_analysis/ta_controller.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Technical Analysis Controller Module"""
__docformat__ = "numpy"
# pylint:disable=too-many-lines,R0904,C0201
# pylint:disable=too-many-lines,R0904,C0201,C0302

import argparse
import logging
Expand Down

0 comments on commit 46fcf9c

Please sign in to comment.