* reformat

* add sortby as command in the regex filter

Co-authored-by: john <john@erlandsen.tech>
Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com>
Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt>
This commit is contained in:
John Inge
2022-10-09 13:11:11 +02:00
committed by GitHub
parent 8f4a716a31
commit a59e041d22
2 changed files with 17 additions and 178 deletions

View File

@@ -41,6 +41,7 @@ from openbb_terminal.helper_funcs import (
EXPORT_ONLY_RAW_DATA_ALLOWED,
print_rich_table,
valid_date,
parse_and_split_input,
)
from openbb_terminal.parent_classes import BaseController
from openbb_terminal.rich_config import console, MenuText
@@ -314,6 +315,22 @@ class EconomyController(BaseController):
self.completer = NestedCompleter.from_nested_dict(self.choices) # type: ignore
def parse_input(self, an_input: str) -> List:
"""Parse controller input
Overrides the parent class function to handle github org/repo path convention.
See `BaseController.parse_input()` for details.
"""
# Filtering out sorting parameters with forward slashes like P/E
sort_filter = r"((\ -s |\ --sortby ).*?(P\/E|Fwd P\/E|P\/S|P\/B|P\/C|P\/FCF)*)"
custom_filters = [sort_filter]
commands = parse_and_split_input(
an_input=an_input, custom_filters=custom_filters
)
return commands
def update_runtime_choices(self):
if session and obbff.USE_PROMPT_TOOLKIT:
if not self.fred_query.empty:

File diff suppressed because it is too large Load Diff