mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-09 10:51:57 +00:00
section description
This commit is contained in:
@@ -108,6 +108,15 @@ class MenuText:
|
||||
"""Append raw text (without translation)."""
|
||||
self.menu_text += text
|
||||
|
||||
def add_section(self, text: str, description: str = ""):
|
||||
"""Append raw text (without translation)."""
|
||||
spacing = (self.CMD_NAME_LENGTH - len(text) + self.SECTION_SPACING) * " "
|
||||
left_spacing = self.SECTION_SPACING * " "
|
||||
if description:
|
||||
text = f"{left_spacing}{text}{spacing}{description}\n"
|
||||
|
||||
self.menu_text += "\n" + text
|
||||
|
||||
def add_custom(self, name: str):
|
||||
"""Append custom text (after translation)."""
|
||||
self.menu_text += f"{i18n.t(self.menu_path + name)}"
|
||||
|
||||
Reference in New Issue
Block a user