move setup_utils_config to configuration module
This commit is contained in:
25
freqtrade/configuration/config_setup.py
Normal file
25
freqtrade/configuration/config_setup.py
Normal file
@@ -0,0 +1,25 @@
|
||||
import logging
|
||||
from typing import Any, Dict
|
||||
|
||||
from .config_validation import validate_config_consistency
|
||||
from .configuration import Configuration
|
||||
from .check_exchange import remove_credentials
|
||||
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
|
Reference in New Issue
Block a user