From 03881cb264de4cf3d74d34df9c92219d3e6e225f Mon Sep 17 00:00:00 2001 From: James Simmons Date: Mon, 7 Nov 2022 18:58:52 -0500 Subject: [PATCH 1/2] fixing categories sort options --- .../overview/overview_controller.py | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/openbb_terminal/cryptocurrency/overview/overview_controller.py b/openbb_terminal/cryptocurrency/overview/overview_controller.py index aa09cffc0ce4..656dc915f1bb 100644 --- a/openbb_terminal/cryptocurrency/overview/overview_controller.py +++ b/openbb_terminal/cryptocurrency/overview/overview_controller.py @@ -135,7 +135,16 @@ def __init__(self, queue: List[str] = None): "--bar": {}, } choices["categories"] = { - "--sortby": {c: {} for c in pycoingecko_model.CATEGORIES_FILTERS}, + "--sortby": { + c: {} + for c in [ + "Name", + "Market_Cap", + "Market_Cap_Change_24H", + "Top_3_Coins", + "Volume_24H", + ] + }, "-s": "--sortby", "--limit": {str(c): {} for c in range(1, 100)}, "-l": "--limit", @@ -765,8 +774,14 @@ def call_categories(self, other_args): dest="sortby", type=str, help="Sort by given column. Default: market_cap_desc", - default=pycoingecko_model.SORT_VALUES[0], - choices=pycoingecko_model.SORT_VALUES, + default="Market_Cap", + choices=[ + "Name", + "Market_Cap", + "Market_Cap_Change_24H", + "Top_3_Coins", + "Volume_24H", + ], ) parser.add_argument( From 132cfdea1dc0e0540a5d3ff622e9920b7f9b66e8 Mon Sep 17 00:00:00 2001 From: james Date: Thu, 10 Nov 2022 11:07:10 -0500 Subject: [PATCH 2/2] edit --- .../overview/overview_controller.py | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/openbb_terminal/cryptocurrency/overview/overview_controller.py b/openbb_terminal/cryptocurrency/overview/overview_controller.py index 656dc915f1bb..fff920681de0 100644 --- a/openbb_terminal/cryptocurrency/overview/overview_controller.py +++ b/openbb_terminal/cryptocurrency/overview/overview_controller.py @@ -90,6 +90,13 @@ class OverviewController(BaseController): PATH = "/crypto/ov/" ORDERED_LIST_SOURCES_EXCHANGES = get_ordered_list_sources(f"{PATH}exchanges") + CATEGORIES_CHOICES = [ + "Name", + "Market_Cap", + "Market_Cap_Change_24H", + "Top_3_Coins", + "Volume_24H", + ] def __init__(self, queue: List[str] = None): """Constructor""" @@ -135,16 +142,7 @@ def __init__(self, queue: List[str] = None): "--bar": {}, } choices["categories"] = { - "--sortby": { - c: {} - for c in [ - "Name", - "Market_Cap", - "Market_Cap_Change_24H", - "Top_3_Coins", - "Volume_24H", - ] - }, + "--sortby": {c: {} for c in self.CATEGORIES_CHOICES}, "-s": "--sortby", "--limit": {str(c): {} for c in range(1, 100)}, "-l": "--limit", @@ -775,13 +773,7 @@ def call_categories(self, other_args): type=str, help="Sort by given column. Default: market_cap_desc", default="Market_Cap", - choices=[ - "Name", - "Market_Cap", - "Market_Cap_Change_24H", - "Top_3_Coins", - "Volume_24H", - ], + choices=self.CATEGORIES_CHOICES, ) parser.add_argument(