summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmaslek <jmaslek11@gmail.com>2021-09-16 11:16:45 -0400
committerGitHub <noreply@github.com>2021-09-16 11:16:45 -0400
commit20eaaab5ac89ffe060db8934db4ae005cc5834f0 (patch)
tree9c270b0c33975a4a0b81200d8723664961bbd7ff
parent0b554c6893aa4e805c27b606f7de7ae6c0eb454d (diff)
Allow for shorthand menu input (#751)
* Allow for shorthand menu input * change to relay
-rw-r--r--gamestonk_terminal/forex/forex_controller.py31
-rw-r--r--terminal.py30
2 files changed, 46 insertions, 15 deletions
diff --git a/gamestonk_terminal/forex/forex_controller.py b/gamestonk_terminal/forex/forex_controller.py
index a2653ee38da..c58d4e71aaf 100644
--- a/gamestonk_terminal/forex/forex_controller.py
+++ b/gamestonk_terminal/forex/forex_controller.py
@@ -9,7 +9,8 @@ from gamestonk_terminal import config_terminal as cfg
from gamestonk_terminal import feature_flags as gtff
from gamestonk_terminal.forex import fx_view
from gamestonk_terminal.forex.behavioural_analysis import ba_controller
-from gamestonk_terminal.forex.exploratory_data_analysis import eda_controller
+
+# from gamestonk_terminal.forex.exploratory_data_analysis import eda_controller
from gamestonk_terminal.helper_funcs import get_flair
from gamestonk_terminal.menu import session
@@ -50,7 +51,7 @@ class ForexController:
]
CHOICES_MENUS = [
- "eda",
+ # "eda",
"ba",
]
@@ -100,9 +101,9 @@ class ForexController:
" reddit search reddit for posts about the loaded instrument"
)
print("")
- print(
- "> eda exploratory data analysis, e.g.: decompose, cusum, residuals analysis"
- )
+ # print(
+ # "> eda exploratory data analysis, e.g.: decompose, cusum, residuals analysis"
+ # )
print(
"> ba behavioural analysis, from: reddit, stocktwits, twitter, google"
)
@@ -208,16 +209,16 @@ class ForexController:
# TODO: Add news and reddit commands back
- def call_eda(self, _):
- try:
- df = fx_view.get_candles_dataframe(account, self.instrument, None)
- df = df.rename(columns={"Close": "Adj Close"})
- instrument = self.instrument
- s_start = pd.to_datetime(df.index.values[0])
- s_interval = "1440min"
- eda_controller.menu(df, instrument, s_start, s_interval)
- except AttributeError:
- print("No data found, do you have your oanda API keys set?")
+ # def call_eda(self, _):
+ # try:
+ # df = fx_view.get_candles_dataframe(account, self.instrument, None)
+ # df = df.rename(columns={"Close": "Adj Close"})
+ # instrument = self.instrument
+ # s_start = pd.to_datetime(df.index.values[0])
+ # s_interval = "1440min"
+ # eda_controller.menu(df, instrument, s_start, s_interval)
+ # except AttributeError:
+ # print("No data found, do you have your oanda API keys set?")
def call_ba(self, _):
instrument = fx_view.format_instrument(self.instrument, " ")
diff --git a/terminal.py b/terminal.py
index 9f7a97f2a58..14bd9302e64 100644
--- a/terminal.py
+++ b/terminal.py
@@ -42,6 +42,7 @@ class TerminalController:
"keys",
]
+ CHOICES_SHORTHAND_MENUS = ["s", "e", "c", "p", "f", "o", "r"]
CHOICES_MENUS = [
"stocks",
"economy",
@@ -55,6 +56,7 @@ class TerminalController:
CHOICES += CHOICES_COMMANDS
CHOICES += CHOICES_MENUS
+ CHOICES += CHOICES_SHORTHAND_MENUS
def __init__(self):
"""Constructor"""
@@ -160,24 +162,40 @@ What do you want to do?
return stocks_controller.menu()
+ def call_s(self, _):
+ """Process stocks command"""
+ return self.call_stocks(_)
+
def call_crypto(self, _):
"""Process crypto command"""
from gamestonk_terminal.cryptocurrency import crypto_controller
return crypto_controller.menu()
+ def call_c(self, _):
+ """Process crypto command"""
+ return self.call_crypto(_)
+
def call_economy(self, _):
"""Process economy command"""
from gamestonk_terminal.economy import economy_controller
return economy_controller.menu()
+ def call_e(self, _):
+ """Process economy command"""
+ return self.call_economy(_)
+
def call_options(self, _):
"""Process options command"""
from gamestonk_terminal.options import options_controller
return options_controller.menu()
+ def call_o(self, _):
+ """Process options command"""
+ return self.call_options(_)
+
def call_etf(self, _):
"""Process etf command"""
from gamestonk_terminal.etf import etf_controller
@@ -190,18 +208,30 @@ What do you want to do?
return forex_controller.menu()
+ def call_f(self, _):
+ """Process forex command"""
+ return self.call_forex(_)
+
def call_resources(self, _):
"""Process resources command"""
from gamestonk_terminal.resources import resources_controller
return resources_controller.menu()
+ def call_r(self, _):
+ """Process resources command"""
+ return self.call_resources(_)
+
def call_portfolio(self, _):
"""Process portfolio command"""
from gamestonk_terminal.portfolio import portfolio_controller
return portfolio_controller.menu()
+ def call_p(self, _):
+ """Process portfolio command"""
+ return self.call_portfolio(_)
+
def terminal():
"""Terminal Menu"""