mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 12:40:35 +00:00
Make it easier for users to configure their terminal colors (#2740)
* Make it easier for users to configure their terminal colors * smaller version of text Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com>
This commit is contained in:
1
i18n/en.yml
vendored
1
i18n/en.yml
vendored
@@ -43,6 +43,7 @@ en:
|
||||
featflags/cmdloc: command location displayed in figures
|
||||
featflags/tbhint: displays usage hints in a bottom toolbar
|
||||
settings/_info_: Settings through environment variables
|
||||
settings/colors: set your own terminal colors
|
||||
settings/autoscaling: plot autoscaling
|
||||
settings/dt: add or remove datetime from flair
|
||||
settings/flair: set the flair emoji to be used
|
||||
|
||||
@@ -100,7 +100,7 @@ class TerminalStyle:
|
||||
"""
|
||||
|
||||
DEFAULT_STYLES_LOCATION = REPOSITORY_DIRECTORY / "styles" / "default"
|
||||
USER_STYLES_LOCATION = USER_DATA_DIRECTORY / "styles"
|
||||
USER_STYLES_LOCATION = USER_DATA_DIRECTORY / "styles" / "user"
|
||||
|
||||
mpl_styles_available: Dict[str, str] = {}
|
||||
mpl_style: str = ""
|
||||
@@ -174,7 +174,10 @@ class TerminalStyle:
|
||||
self.mpf_style = json.load(stylesheet)
|
||||
self.mpf_style["base_mpl_style"] = self.mpl_style
|
||||
|
||||
if console_style in self.console_styles_available:
|
||||
if "openbb_config" in self.console_styles_available:
|
||||
with open(self.console_styles_available["openbb_config"]) as stylesheet:
|
||||
self.console_style = json.load(stylesheet)
|
||||
elif console_style in self.console_styles_available:
|
||||
with open(self.console_styles_available[console_style]) as stylesheet:
|
||||
self.console_style = json.load(stylesheet)
|
||||
else:
|
||||
|
||||
@@ -54,6 +54,7 @@ class SettingsController(BaseController):
|
||||
"userdata",
|
||||
"source",
|
||||
"flair",
|
||||
"colors",
|
||||
]
|
||||
PATH = "/settings/"
|
||||
|
||||
@@ -81,6 +82,7 @@ class SettingsController(BaseController):
|
||||
mt = MenuText("settings/")
|
||||
mt.add_info("_info_")
|
||||
mt.add_raw("\n")
|
||||
mt.add_cmd("colors")
|
||||
mt.add_setting("dt", obbff.USE_DATETIME)
|
||||
mt.add_cmd("flair")
|
||||
mt.add_raw("\n")
|
||||
@@ -134,6 +136,21 @@ class SettingsController(BaseController):
|
||||
|
||||
console.print(text=mt.menu_text, menu="Settings")
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def call_colors(self, _):
|
||||
"""Process colors command"""
|
||||
console.print(
|
||||
"\n1. Play with the terminal coloring embedded in our website https://openbb.co/customize\n"
|
||||
)
|
||||
console.print("2. Once happy, click 'Download Theme'\n")
|
||||
console.print(
|
||||
"3. The file 'openbb_config.richstyle.json' should be downloaded\n"
|
||||
)
|
||||
console.print(
|
||||
"4. Insert that config file inside /OpenBBUserData/styles/user/\n"
|
||||
)
|
||||
console.print("5. Close the terminal and run it again.\n")
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def call_dt(self, _):
|
||||
"""Process dt command"""
|
||||
|
||||
Reference in New Issue
Block a user