Updating ARK view

This commit is contained in:
Artem Veremey
2021-03-28 13:40:35 -07:00
parent 326fcc43c7
commit 4b873be319
2 changed files with 25 additions and 4 deletions

View File

@@ -2,6 +2,7 @@
__docformat__ = "numpy"
import argparse
from typing import List
from colorama import Fore, Style
import pandas as pd
@@ -16,6 +17,19 @@ from gamestonk_terminal.discovery import ark_model
def direction_color_red_green(val: str) -> str:
"""Adds color tags to the Direction information: Buy -> Green, Sell -> Red
Parameters
----------
val : str
Direction string - either Buy or Sell
Returns
-------
str
Direction string with color tags added
"""
if val == "Buy":
ret = Fore.GREEN + val + Style.RESET_ALL
elif val == "Sell":
@@ -26,7 +40,14 @@ def direction_color_red_green(val: str) -> str:
return ret
def ark_orders(l_args):
def ark_orders_view(other_args: List[str]):
"""Prints a table of the last N ARK Orders
Parameters
----------
other_args : List[str]
argparse other args - ["-n", "10"]
"""
parser = argparse.ArgumentParser(
add_help=False,
prog="ARK Orders",
@@ -45,7 +66,7 @@ def ark_orders(l_args):
help="Last N orders.",
)
ns_parser = parse_known_args_and_warn(parser, l_args)
ns_parser = parse_known_args_and_warn(parser, other_args)
if not ns_parser:
return

View File

@@ -1,5 +1,6 @@
import argparse
from typing import List
from prompt_toolkit.completion import NestedCompleter
from gamestonk_terminal import feature_flags as gtff
from gamestonk_terminal.helper_funcs import get_flair
@@ -16,7 +17,6 @@ from gamestonk_terminal.discovery import (
unusual_whales_view,
yahoo_finance_view,
)
from prompt_toolkit.completion import NestedCompleter
class DiscoveryController:
@@ -126,7 +126,7 @@ class DiscoveryController:
def call_ark_orders(self, other_args: List[str]):
"""Process ark_orders command"""
ark_view.ark_orders(other_args)
ark_view.ark_orders_view(other_args)
def call_up_earnings(self, other_args: List[str]):
"""Process up_earnings command"""