mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-31 22:41:19 +00:00
[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:
@@ -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."
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user