mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-30 21:22:24 +00:00
init (#4683)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
# pylint: disable=R0902
|
||||
import importlib
|
||||
import inspect
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, List, Optional, Type, Union
|
||||
@@ -219,7 +218,11 @@ class PlotlyTA(PltTA):
|
||||
@staticmethod
|
||||
def _locate_plugins() -> None:
|
||||
"""Locate all the plugins in the plugins folder"""
|
||||
path = REPOSITORY_DIRECTORY if hasattr(sys, "frozen") else Path(os.getcwd())
|
||||
path = (
|
||||
Path(sys.executable).parent
|
||||
if hasattr(sys, "frozen")
|
||||
else REPOSITORY_DIRECTORY
|
||||
)
|
||||
current_system = get_current_system()
|
||||
|
||||
# This is for debugging purposes
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# IMPORTS STANDARD
|
||||
import sys
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
# IMPORTS THIRDPARTY
|
||||
@@ -11,18 +12,23 @@ from openbb_terminal.core.config.paths import (
|
||||
SETTINGS_ENV_FILE,
|
||||
)
|
||||
|
||||
DEFAULT_ORDER = [
|
||||
SETTINGS_ENV_FILE,
|
||||
PACKAGE_ENV_FILE,
|
||||
REPOSITORY_ENV_FILE,
|
||||
]
|
||||
|
||||
|
||||
def read_env() -> Dict[str, Any]:
|
||||
__env_dict: Dict[str, Optional[str]] = {}
|
||||
local_order = DEFAULT_ORDER.copy()
|
||||
|
||||
if SETTINGS_ENV_FILE.exists():
|
||||
__env_dict.update(**dotenv_values(SETTINGS_ENV_FILE))
|
||||
if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"):
|
||||
local_order.reverse()
|
||||
|
||||
if PACKAGE_ENV_FILE.exists():
|
||||
__env_dict.update(**dotenv_values(PACKAGE_ENV_FILE))
|
||||
|
||||
if REPOSITORY_ENV_FILE.exists():
|
||||
__env_dict.update(**dotenv_values(REPOSITORY_ENV_FILE))
|
||||
for env_file in local_order:
|
||||
if env_file.exists():
|
||||
__env_dict.update(**dotenv_values(env_file))
|
||||
|
||||
__env_dict_filtered = {
|
||||
k[len("OPENBBB_") - 1 :]: v
|
||||
|
||||
Reference in New Issue
Block a user