mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-30 22:11:55 +00:00
mypy
This commit is contained in:
@@ -36,8 +36,8 @@ def remove_login_file() -> Union[Success, Failure]:
|
||||
|
||||
Returns
|
||||
-------
|
||||
Success
|
||||
The status of the local logout.
|
||||
Union[Success, Failure]
|
||||
The status of the file removal, or an error.
|
||||
"""
|
||||
|
||||
try:
|
||||
@@ -45,6 +45,7 @@ def remove_login_file() -> Union[Success, Failure]:
|
||||
if os.path.isfile(file_path):
|
||||
os.remove(file_path)
|
||||
return Success("[green]\nRemoved login info.[/green]")
|
||||
return Success()
|
||||
except Exception:
|
||||
return Failure("[red]\nFailed to remove login file.[/red]")
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ from openbb_terminal.rich_config import console
|
||||
|
||||
from openbb_terminal.terminal_helper import suppress_stdout
|
||||
from openbb_terminal.portfolio.brokers.degiro.degiro_model import DegiroModel
|
||||
from openbb_terminal.account.sync_model import put_user_configs
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -237,6 +238,14 @@ def set_key(env_var_name: str, env_var_value: str, persist: bool = False) -> Non
|
||||
# Set cfg.env_var_name = env_var_value
|
||||
setattr(cfg, env_var_name, env_var_value)
|
||||
|
||||
# Just for testing, replace when patch is available,
|
||||
# this overwrites the whole config dict
|
||||
data = {
|
||||
"features_settings": {},
|
||||
"features_keys": {env_var_name: env_var_value},
|
||||
}
|
||||
put_user_configs(data)
|
||||
|
||||
|
||||
def get_keys(show: bool = False) -> pd.DataFrame:
|
||||
"""Get currently set API keys.
|
||||
|
||||
Reference in New Issue
Block a user