have Arguments return a dict instead of Namespace

This commit is contained in:
Matthias
2019-09-12 20:16:39 +02:00
parent 52b186eabe
commit e6ccc1427c
6 changed files with 56 additions and 60 deletions

View File

@@ -1,18 +1,18 @@
from argparse import Namespace
from typing import Any, Dict
from freqtrade import OperationalException
from freqtrade.state import RunMode
from freqtrade.utils import setup_utils_configuration
def validate_plot_args(args: Namespace):
args_tmp = vars(args)
if not args_tmp.get('datadir') and not args_tmp.get('config'):
def validate_plot_args(args: Dict[str, Any]):
if not args.get('datadir') and not args.get('config'):
raise OperationalException(
"You need to specify either `--datadir` or `--config` "
"for plot-profit and plot-dataframe.")
def start_plot_dataframe(args: Namespace) -> None:
def start_plot_dataframe(args: Dict[str, Any]) -> None:
"""
Entrypoint for dataframe plotting
"""
@@ -24,7 +24,7 @@ def start_plot_dataframe(args: Namespace) -> None:
load_and_plot_trades(config)
def start_plot_profit(args: Namespace) -> None:
def start_plot_profit(args: Dict[str, Any]) -> None:
"""
Entrypoint for plot_profit
"""