mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-11 20:01:16 +00:00
print_help when jump back to previous menu (#1168)
* print_help when jump back to previous menu * help when quitting * default flag to False Co-authored-by: theorish <tep@foundian.com> Co-authored-by: DidierRLopes <dro.lopes@campus.fct.unl.pt>
This commit is contained in:
@@ -42,3 +42,6 @@ ENABLE_QUICK_EXIT = strtobool(os.getenv("GTFF_ENABLE_QUICK_EXIT", "False"))
|
||||
|
||||
# Open report as HTML, otherwise notebook
|
||||
OPEN_REPORT_AS_HTML = strtobool(os.getenv("GTFF_OPEN_REPORT_AS_HTML", "True"))
|
||||
|
||||
# Enable auto print_help when exiting menus
|
||||
ENABLE_EXIT_AUTO_HELP = strtobool(os.getenv("GTFF_ENABLE_EXIT_AUTO_HELP", "False"))
|
||||
|
||||
@@ -185,6 +185,9 @@ class BaseController(metaclass=ABCMeta):
|
||||
|
||||
if len(self.queue) > 1:
|
||||
return self.queue[1:]
|
||||
|
||||
if gtff.ENABLE_EXIT_AUTO_HELP:
|
||||
return ["help"]
|
||||
return []
|
||||
|
||||
# Consume 1 element from the queue
|
||||
|
||||
@@ -230,6 +230,9 @@ def terminal(jobs_cmds: List[str] = None):
|
||||
print_goodbye()
|
||||
break
|
||||
|
||||
if gtff.ENABLE_EXIT_AUTO_HELP and len(t_controller.queue) > 1:
|
||||
t_controller.queue = t_controller.queue[1:]
|
||||
|
||||
# Consume 1 element from the queue
|
||||
an_input = t_controller.queue[0]
|
||||
t_controller.queue = t_controller.queue[1:]
|
||||
|
||||
Reference in New Issue
Block a user