move setup_utils_config to configuration module

This commit is contained in:
Matthias
2020-01-26 13:55:48 +01:00
parent 8c9119b471
commit 02563019fc
12 changed files with 15 additions and 18 deletions

View File

@@ -23,4 +23,3 @@ from freqtrade.commands.pairlist_commands import start_test_pairlist
from freqtrade.commands.plot_commands import (start_plot_dataframe,
start_plot_profit)
from freqtrade.commands.trade_commands import start_trading
from freqtrade.commands.utils import setup_utils_configuration

View File

@@ -4,14 +4,13 @@ from typing import Any, Dict, List
import arrow
from freqtrade.configuration import TimeRange
from freqtrade.configuration import TimeRange, setup_utils_configuration
from freqtrade.data.history import (convert_trades_to_ohlcv,
refresh_backtest_ohlcv_data,
refresh_backtest_trades_data)
from freqtrade.exceptions import OperationalException
from freqtrade.resolvers import ExchangeResolver
from freqtrade.state import RunMode
from .utils import setup_utils_configuration
logger = logging.getLogger(__name__)

View File

@@ -3,6 +3,7 @@ import sys
from pathlib import Path
from typing import Any, Dict
from freqtrade.configuration import setup_utils_configuration
from freqtrade.configuration.directory_operations import (copy_sample_files,
create_userdata_dir)
from freqtrade.constants import USERPATH_HYPEROPTS, USERPATH_STRATEGY
@@ -10,8 +11,6 @@ from freqtrade.exceptions import OperationalException
from freqtrade.misc import render_template
from freqtrade.state import RunMode
from .utils import setup_utils_configuration
logger = logging.getLogger(__name__)

View File

@@ -4,7 +4,7 @@ from typing import Any, Dict, List
from colorama import init as colorama_init
from .utils import setup_utils_configuration
from freqtrade.configuration import setup_utils_configuration
from freqtrade.exceptions import OperationalException
from freqtrade.state import RunMode

View File

@@ -8,6 +8,7 @@ from typing import Any, Dict
import rapidjson
from tabulate import tabulate
from freqtrade.configuration import setup_utils_configuration
from freqtrade.constants import USERPATH_STRATEGY
from freqtrade.exceptions import OperationalException
from freqtrade.exchange import (available_exchanges, ccxt_exchanges,
@@ -16,8 +17,6 @@ from freqtrade.misc import plural
from freqtrade.resolvers import ExchangeResolver, StrategyResolver
from freqtrade.state import RunMode
from .utils import setup_utils_configuration
logger = logging.getLogger(__name__)

View File

@@ -2,7 +2,7 @@ import logging
from typing import Any, Dict
from freqtrade import constants
from freqtrade.commands.utils import setup_utils_configuration
from freqtrade.configuration import setup_utils_configuration
from freqtrade.exceptions import DependencyException, OperationalException
from freqtrade.state import RunMode

View File

@@ -3,11 +3,10 @@ from typing import Any, Dict
import rapidjson
from freqtrade.configuration import setup_utils_configuration
from freqtrade.resolvers import ExchangeResolver
from freqtrade.state import RunMode
from .utils import setup_utils_configuration
logger = logging.getLogger(__name__)

View File

@@ -1,8 +1,8 @@
from typing import Any, Dict
from freqtrade.configuration import setup_utils_configuration
from freqtrade.exceptions import OperationalException
from freqtrade.state import RunMode
from freqtrade.commands.utils import setup_utils_configuration
def validate_plot_args(args: Dict[str, Any]):

View File

@@ -1,24 +0,0 @@
import logging
from typing import Any, Dict
from freqtrade.configuration import (Configuration, remove_credentials,
validate_config_consistency)
from freqtrade.state import RunMode
logger = logging.getLogger(__name__)
def setup_utils_configuration(args: Dict[str, Any], method: RunMode) -> Dict[str, Any]:
"""
Prepare the configuration for utils subcommands
:param args: Cli args from Arguments()
:return: Configuration
"""
configuration = Configuration(args, method)
config = configuration.get_config()
# Ensure we do not use Exchange credentials
remove_credentials(config)
validate_config_consistency(config)
return config