mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 04:31:13 +00:00
* Added init files fixed pylint * Updated coverage settings * Fixing pylint issues * Refactored residual_api imports * Fixing pylint * Fixing pylint * Update fx_view.py * Fixed black * Removing ignore Co-authored-by: Colin Delahunty <colindelahunty@Colins-Air.attlocal.net>
31 lines
900 B
Python
31 lines
900 B
Python
import os
|
|
|
|
from matplotlib import pyplot
|
|
|
|
from prompt_toolkit import PromptSession
|
|
from prompt_toolkit.eventloop.inputhook import set_eventloop_with_inputhook
|
|
from prompt_toolkit.history import FileHistory
|
|
|
|
|
|
def inputhook(inputhook_context):
|
|
while not inputhook_context.input_is_ready():
|
|
try:
|
|
pyplot.pause(0.1)
|
|
# pylint: disable=unused-variable
|
|
except Exception: # noqa: F841
|
|
continue
|
|
return False
|
|
|
|
|
|
history_file = os.path.join(os.path.expanduser("~"), ".gamestonk_terminal.his")
|
|
|
|
try:
|
|
session = PromptSession(history=FileHistory(history_file)) # type: ignore
|
|
set_eventloop_with_inputhook(inputhook)
|
|
# pylint: disable=unused-variable
|
|
except Exception as e: # noqa: F841
|
|
print(
|
|
"WARNING: Prompt toolkit is turned on but did not initialize successfully. Falling back to input()..."
|
|
)
|
|
session = None # type: ignore
|