mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-30 05:52:23 +00:00
fix double exit logout bug
This commit is contained in:
@@ -60,5 +60,3 @@ def logout():
|
||||
"""
|
||||
system_clear()
|
||||
remove_login_file()
|
||||
console.print("")
|
||||
login_controller.login_prompt(welcome=True)
|
||||
|
||||
@@ -11,10 +11,13 @@ import os
|
||||
import re
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from datetime import datetime, timedelta
|
||||
import subprocess
|
||||
import sys
|
||||
from typing import Any, Dict, List, Union
|
||||
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
import matplotlib.pyplot as plt
|
||||
from prompt_toolkit.formatted_text import HTML
|
||||
from prompt_toolkit.styles import Style
|
||||
from rich.markdown import Markdown
|
||||
@@ -673,6 +676,12 @@ class BaseController(metaclass=ABCMeta):
|
||||
|
||||
if ns_parser:
|
||||
logout()
|
||||
plt.close("all")
|
||||
out = subprocess.run( # nosec
|
||||
f"{sys.executable} terminal.py", shell=True, check=False
|
||||
)
|
||||
if out.returncode != 0:
|
||||
console.print("Unfortunately, resetting wasn't possible!\n")
|
||||
|
||||
@log_start_end(log=logger)
|
||||
def call_whoami(self, other_args: List[str]) -> None:
|
||||
|
||||
@@ -901,6 +901,9 @@ def terminal(jobs_cmds: List[str] = None, test_mode=False):
|
||||
try:
|
||||
# Process the input command
|
||||
t_controller.queue = t_controller.switch(an_input)
|
||||
if an_input == "logout":
|
||||
break
|
||||
|
||||
if an_input in ("q", "quit", "..", "exit", "e"):
|
||||
print_goodbye()
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user