mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 04:31:13 +00:00
Bug/2804 e comman wont exit term (#2816)
* add branch * fix e not working * fix e not working again * Delete microsoft.gpg Co-authored-by: john <john@debian-BULLSEYE-live-builder-AMD64> Co-authored-by: Colin Delahunty <72827203+colin99d@users.noreply.github.com> Co-authored-by: erlandsen-tech <john@erlandsen.tech> Co-authored-by: colin99d <colin99delahunty@gmail.com>
This commit is contained in:
@@ -3,49 +3,47 @@ __docformat__ = "numpy"
|
||||
|
||||
# pylint: disable=C0301,C0302,R0902,global-statement
|
||||
|
||||
from abc import ABCMeta, abstractmethod
|
||||
import argparse
|
||||
import re
|
||||
import os
|
||||
import difflib
|
||||
import logging
|
||||
import json
|
||||
|
||||
from typing import Union, Any, List, Dict
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from datetime import datetime, timedelta
|
||||
from typing import Any, Dict, List, Union
|
||||
|
||||
from prompt_toolkit.styles import Style
|
||||
from prompt_toolkit.formatted_text import HTML
|
||||
from rich.markdown import Markdown
|
||||
import pandas as pd
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
from prompt_toolkit.formatted_text import HTML
|
||||
from prompt_toolkit.styles import Style
|
||||
from rich.markdown import Markdown
|
||||
|
||||
from openbb_terminal.core.config.paths import (
|
||||
USER_CUSTOM_IMPORTS_DIRECTORY,
|
||||
USER_ROUTINES_DIRECTORY,
|
||||
)
|
||||
from openbb_terminal.decorators import log_start_end
|
||||
|
||||
from openbb_terminal.custom_prompt_toolkit import NestedCompleter
|
||||
from openbb_terminal.menu import session
|
||||
from openbb_terminal import feature_flags as obbff
|
||||
from openbb_terminal.config_terminal import theme
|
||||
from openbb_terminal.helper_funcs import (
|
||||
system_clear,
|
||||
get_flair,
|
||||
valid_date,
|
||||
parse_simple_args,
|
||||
set_command_location,
|
||||
prefill_form,
|
||||
support_message,
|
||||
check_file_type_saved,
|
||||
check_positive,
|
||||
export_data,
|
||||
get_flair,
|
||||
load_json,
|
||||
parse_and_split_input,
|
||||
search_wikipedia,
|
||||
parse_simple_args,
|
||||
prefill_form,
|
||||
screenshot,
|
||||
export_data,
|
||||
search_wikipedia,
|
||||
set_command_location,
|
||||
support_message,
|
||||
system_clear,
|
||||
valid_date,
|
||||
)
|
||||
from openbb_terminal.config_terminal import theme
|
||||
from openbb_terminal.rich_config import console, get_ordered_list_sources
|
||||
from openbb_terminal.stocks import stocks_helper
|
||||
from openbb_terminal.terminal_helper import open_openbb_documentation
|
||||
@@ -86,6 +84,7 @@ class BaseController(metaclass=ABCMeta):
|
||||
"q",
|
||||
"quit",
|
||||
"..",
|
||||
"e",
|
||||
"exit",
|
||||
"r",
|
||||
"reset",
|
||||
@@ -313,6 +312,8 @@ class BaseController(metaclass=ABCMeta):
|
||||
if known_args.cmd:
|
||||
if known_args.cmd in ("..", "q"):
|
||||
known_args.cmd = "quit"
|
||||
elif known_args.cmd in ("e"):
|
||||
known_args.cmd = "exit"
|
||||
elif known_args.cmd in ("?", "h"):
|
||||
known_args.cmd = "help"
|
||||
elif known_args.cmd == "r":
|
||||
|
||||
@@ -10,28 +10,27 @@ from typing import List
|
||||
import financedatabase
|
||||
import yfinance as yf
|
||||
|
||||
from openbb_terminal.custom_prompt_toolkit import NestedCompleter
|
||||
|
||||
from openbb_terminal import feature_flags as obbff
|
||||
from openbb_terminal.common import feedparser_view, newsapi_view
|
||||
from openbb_terminal.common.quantitative_analysis import qa_view
|
||||
from openbb_terminal.custom_prompt_toolkit import NestedCompleter
|
||||
from openbb_terminal.decorators import log_start_end
|
||||
from openbb_terminal.stocks import cboe_view
|
||||
|
||||
from openbb_terminal.helper_classes import AllowArgsWithWhiteSpace
|
||||
from openbb_terminal.helper_funcs import (
|
||||
EXPORT_ONLY_RAW_DATA_ALLOWED,
|
||||
choice_check_after_action,
|
||||
export_data,
|
||||
valid_date,
|
||||
)
|
||||
from openbb_terminal.helper_classes import AllowArgsWithWhiteSpace
|
||||
from openbb_terminal.helper_funcs import choice_check_after_action
|
||||
from openbb_terminal.menu import session
|
||||
from openbb_terminal.parent_classes import StockBaseController
|
||||
from openbb_terminal.rich_config import (
|
||||
console,
|
||||
translate,
|
||||
MenuText,
|
||||
console,
|
||||
get_ordered_list_sources,
|
||||
translate,
|
||||
)
|
||||
from openbb_terminal.stocks import stocks_helper
|
||||
|
||||
@@ -586,9 +585,7 @@ class StocksController(StockBaseController):
|
||||
@log_start_end(log=logger)
|
||||
def call_disc(self, _):
|
||||
"""Process disc command"""
|
||||
from openbb_terminal.stocks.discovery.disc_controller import (
|
||||
DiscoveryController,
|
||||
)
|
||||
from openbb_terminal.stocks.discovery.disc_controller import DiscoveryController
|
||||
|
||||
self.queue = self.load_class(DiscoveryController, self.queue)
|
||||
|
||||
@@ -626,9 +623,7 @@ class StocksController(StockBaseController):
|
||||
@log_start_end(log=logger)
|
||||
def call_ins(self, _):
|
||||
"""Process ins command"""
|
||||
from openbb_terminal.stocks.insider.insider_controller import (
|
||||
InsiderController,
|
||||
)
|
||||
from openbb_terminal.stocks.insider.insider_controller import InsiderController
|
||||
|
||||
self.queue = self.load_class(
|
||||
InsiderController,
|
||||
@@ -649,9 +644,7 @@ class StocksController(StockBaseController):
|
||||
@log_start_end(log=logger)
|
||||
def call_options(self, _):
|
||||
"""Process options command"""
|
||||
from openbb_terminal.stocks.options.options_controller import (
|
||||
OptionsController,
|
||||
)
|
||||
from openbb_terminal.stocks.options.options_controller import OptionsController
|
||||
|
||||
self.queue = self.load_class(OptionsController, self.ticker, self.queue)
|
||||
|
||||
@@ -773,9 +766,7 @@ class StocksController(StockBaseController):
|
||||
def call_qa(self, _):
|
||||
"""Process qa command"""
|
||||
if self.ticker:
|
||||
from openbb_terminal.stocks.quantitative_analysis import (
|
||||
qa_controller,
|
||||
)
|
||||
from openbb_terminal.stocks.quantitative_analysis import qa_controller
|
||||
|
||||
self.queue = self.load_class(
|
||||
qa_controller.QaController,
|
||||
|
||||
@@ -706,7 +706,7 @@ def terminal(jobs_cmds: List[str] = None, appName: str = "gst"):
|
||||
try:
|
||||
# Process the input command
|
||||
t_controller.queue = t_controller.switch(an_input)
|
||||
if an_input in ("q", "quit", "..", "exit"):
|
||||
if an_input in ("q", "quit", "..", "exit", "e"):
|
||||
print_goodbye()
|
||||
break
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from openbb_terminal.terminal_controller import parse_args_and_run
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parse_args_and_run()
|
||||
|
||||
Reference in New Issue
Block a user