[Feature] - Display command providers (#6355)

* fix: avoid calling Session() multiple times

* rename session refs

* fix: cmd text

* fix: avoid Session()

* fix: add providers by cmd

* fix: timezones

---------

Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com>
This commit is contained in:
montezdesousa
2024-05-01 22:17:02 +01:00
committed by GitHub
parent c45997567c
commit a0d580ab25
9 changed files with 253 additions and 240 deletions

View File

@@ -7,6 +7,8 @@ from typing import Dict, List, Match, Optional, Tuple, Union
from dateutil.relativedelta import relativedelta
from openbb_cli.session import Session
session = Session()
# pylint: disable=too-many-statements,eval-used,consider-iterating-dictionary
# pylint: disable=too-many-branches,too-many-return-statements
@@ -194,7 +196,7 @@ def parse_openbb_script( # noqa: PLR0911,PLR0912
# Just throw a warning when user uses wrong convention
numdollars = len(re.findall(r"\$", line))
if numdollars > 1:
Session().console.print(
session.console.print(
f"The variable {VAR_NAME} should not be declared as "
f"{'$' * numdollars}{VAR_NAME}. Instead it will be "
f"converted into ${VAR_NAME}."
@@ -445,7 +447,7 @@ def parse_openbb_script( # noqa: PLR0911,PLR0912
final_lines.append(foreach_line_loop.strip())
if not varused_inside:
Session().console.print(
session.console.print(
f"The variable {varname} was used in foreach header "
"but it wasn't used inside the loop."
)