summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorteh_coderer <me@tehcoderer.com>2023-03-08 08:24:33 -0600
committerGitHub <noreply@github.com>2023-03-08 08:24:33 -0600
commitb87b04e6a20f3666c98e6a7dc418fbf82873d4b7 (patch)
tree7ddb13262893aff084cb473398fa71c688dc0df7
parent0d219fdb6e243ffefb5068925261af448c21f7ee (diff)
parent291bb18dfa6b2f10d7166cff0c77f6840fdc3ce7 (diff)
Merge branch 'develop' into feature/tables
-rw-r--r--openbb_terminal/config_terminal.py14
-rw-r--r--openbb_terminal/core/sdk/sdk_helpers.py4
-rw-r--r--openbb_terminal/cryptocurrency/technical_analysis/ta_controller.py6
-rw-r--r--openbb_terminal/sdk.py4
-rw-r--r--terminal.py9
5 files changed, 18 insertions, 19 deletions
diff --git a/openbb_terminal/config_terminal.py b/openbb_terminal/config_terminal.py
index 44d7a66830c..ee34f9470ff 100644
--- a/openbb_terminal/config_terminal.py
+++ b/openbb_terminal/config_terminal.py
@@ -5,14 +5,15 @@ import os
import i18n
# IMPORTATION INTERNAL
-from openbb_terminal.base_helpers import load_env_vars, strtobool
+from openbb_terminal.base_helpers import load_env_vars, strtobool, load_env_files
from openbb_terminal.core.config.paths import MISCELLANEOUS_DIRECTORY
from openbb_terminal.core.plots.backend import plots_backend
from openbb_terminal.core.session.current_user import get_current_user
+from openbb_terminal.core.config.paths_helper import init_userdata
from .helper_classes import TerminalStyle as _TerminalStyle
-# # Terminal UX section
+# Terminal UX section
current_user = get_current_user()
theme = _TerminalStyle(
current_user.preferences.MPL_STYLE,
@@ -20,8 +21,13 @@ theme = _TerminalStyle(
current_user.preferences.RICH_STYLE,
)
-# Start Backend for plotting
-plots_backend().start(load_env_vars("DEBUG_MODE", strtobool, False))
+
+def start_required_configurations():
+ """Starts the required configurations for the terminal to work"""
+ load_env_files()
+ init_userdata()
+ plots_backend().start(load_env_vars("DEBUG_MODE", strtobool, False))
+
# Logging section
diff --git a/openbb_terminal/core/sdk/sdk_helpers.py b/openbb_terminal/core/sdk/sdk_helpers.py
index 9eab5b88a51..00c003c1b03 100644
--- a/openbb_terminal/core/sdk/sdk_helpers.py
+++ b/openbb_terminal/core/sdk/sdk_helpers.py
@@ -336,7 +336,6 @@ import logging
import openbb_terminal.config_terminal as cfg
from openbb_terminal import helper_funcs as helper # noqa: F401
-from openbb_terminal.base_helpers import load_env_files
from openbb_terminal.config_terminal import theme
from openbb_terminal.cryptocurrency.due_diligence.pycoingecko_model import Coin
@@ -353,8 +352,7 @@ from openbb_terminal.core.sdk import (
from openbb_terminal.core.session.current_user import is_local
from openbb_terminal.terminal_helper import is_auth_enabled
-load_env_files()
-init_userdata()
+cfg.start_required_configurations()
logger = logging.getLogger(__name__)
theme.applyMPLstyle()
diff --git a/openbb_terminal/cryptocurrency/technical_analysis/ta_controller.py b/openbb_terminal/cryptocurrency/technical_analysis/ta_controller.py
index d3b2defb290..005933506f2 100644
--- a/openbb_terminal/cryptocurrency/technical_analysis/ta_controller.py
+++ b/openbb_terminal/cryptocurrency/technical_analysis/ta_controller.py
@@ -1,6 +1,6 @@
"""Crypto Technical Analysis Controller Module"""
__docformat__ = "numpy"
-# pylint:disable=too-many-lines,R0904,C0201
+# pylint: disable=R0904,C0201,C0302
import argparse
import logging
@@ -1486,8 +1486,8 @@ class TechnicalAnalysisController(CryptoBaseController):
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
prog="cones",
description="""
- Calculates the realized volatility quantiles over rolling windows of time.
- The model for calculating volatility is selectable.
+ Calculates the realized volatility quantiles over rolling windows of time.
+ The model for calculating volatility is selectable.
""",
)
parser.add_argument(
diff --git a/openbb_terminal/sdk.py b/openbb_terminal/sdk.py
index a1df14b3b34..a995e7ae44d 100644
--- a/openbb_terminal/sdk.py
+++ b/openbb_terminal/sdk.py
@@ -7,7 +7,6 @@ import logging
import openbb_terminal.config_terminal as cfg
from openbb_terminal import helper_funcs as helper # noqa: F401
-from openbb_terminal.base_helpers import load_env_files
from openbb_terminal.config_terminal import theme
from openbb_terminal.cryptocurrency.due_diligence.pycoingecko_model import Coin
@@ -24,8 +23,7 @@ from openbb_terminal.core.sdk import (
from openbb_terminal.core.session.current_user import is_local
from openbb_terminal.terminal_helper import is_auth_enabled
-load_env_files()
-init_userdata()
+cfg.start_required_configurations()
logger = logging.getLogger(__name__)
theme.applyMPLstyle()
diff --git a/terminal.py b/terminal.py
index 4401dc078c6..a19009b6bd2 100644
--- a/terminal.py
+++ b/terminal.py
@@ -1,19 +1,16 @@
import sys
from multiprocessing import freeze_support
+# pylint:disable=unused-import,import-outside-toplevel
+import openbb_terminal.config_terminal as cfg # noqa: F401
import openbb_terminal.core.session.current_user as _ # noqa: F401
-from openbb_terminal.base_helpers import load_env_files
-from openbb_terminal.core.config.paths_helper import init_userdata
from openbb_terminal.terminal_helper import is_auth_enabled
-# pylint: disable=import-outside-toplevel
-
def main():
sent_args = sys.argv[1:]
- load_env_files()
- init_userdata()
+ cfg.start_required_configurations()
if "-t" in sent_args or "--test" in sent_args:
from openbb_terminal.core.integration_tests import integration_controller