mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-04 08:22:26 +00:00
Adds auto completion to news (#4089)
* Fix plot look when using eval and add query to choices (#3881)
* convert index to datetime and update choices
* uncomment economy integration test
* fix treasury concat bug
* fix datasets concat on duplciates
* Lock ruff version so that new lints dont break our CI (#3905)
* Lock ruff version so that new lints dont break our CI
* Bumped pre-commit ruff version
* returning always a dataframe
* Revert "returning always a dataframe"
This reverts commit d5dbf3132f.
* quick fix to auto complete args
---------
Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com>
Co-authored-by: Colin Delahunty <72827203+colin99d@users.noreply.github.com>
Co-authored-by: James Maslek <jmaslek11@gmail.com>
This commit is contained in:
@@ -100,6 +100,7 @@ class BaseController(metaclass=ABCMeta):
|
||||
CHOICES_MENUS: List[str] = []
|
||||
SUPPORT_CHOICES: dict = {}
|
||||
ABOUT_CHOICES: dict = {}
|
||||
NEWS_CHOICES: dict = {}
|
||||
COMMAND_SEPARATOR = "/"
|
||||
KEYS_MENU = "keys" + COMMAND_SEPARATOR
|
||||
TRY_RELOAD = False
|
||||
@@ -160,6 +161,7 @@ class BaseController(metaclass=ABCMeta):
|
||||
c for c in self.controller_choices if c not in self.CHOICES_COMMON
|
||||
]
|
||||
|
||||
# Add in support options
|
||||
support_choices: dict = {c: {} for c in self.controller_choices}
|
||||
|
||||
support_choices = {c: None for c in (["generic"] + self.support_commands)}
|
||||
@@ -174,6 +176,10 @@ class BaseController(metaclass=ABCMeta):
|
||||
|
||||
self.SUPPORT_CHOICES = support_choices
|
||||
|
||||
# Add in news options
|
||||
news_choices = ["--term", "-t", "--sources", "-s", "--help", "-h"]
|
||||
self.NEWS_CHOICES = {c: None for c in news_choices}
|
||||
|
||||
def check_path(self) -> None:
|
||||
"""Check if command path is valid."""
|
||||
path = self.PATH
|
||||
|
||||
@@ -151,6 +151,7 @@ class TerminalController(BaseController):
|
||||
choices: dict = {c: {} for c in self.controller_choices}
|
||||
choices["support"] = self.SUPPORT_CHOICES
|
||||
choices["exe"] = self.ROUTINE_CHOICES
|
||||
choices["news"] = self.NEWS_CHOICES
|
||||
|
||||
self.completer = NestedCompleter.from_nested_dict(choices)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user