From a1b91ad1ead5831c260a7972416ba4fb705a5056 Mon Sep 17 00:00:00 2001 From: gcarq Date: Wed, 8 Nov 2017 21:17:51 +0100 Subject: [PATCH] remove unneeded wrapper function --- freqtrade/main.py | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/freqtrade/main.py b/freqtrade/main.py index f1228cc08..2371f90a9 100755 --- a/freqtrade/main.py +++ b/freqtrade/main.py @@ -250,15 +250,21 @@ def cleanup(*args, **kwargs) -> None: exit(0) -def app(config: dict) -> None: +def main(): """ - Main loop which handles the application state - :param config: config as dict + Loads and validates the config and handles the main loop :return: None """ logger.info('Starting freqtrade %s', __version__) - init(config) + global _CONF + with open('config.json') as file: + _CONF = json.load(file) + + logger.info('Validating configuration ...') + validate(_CONF, CONF_SCHEMA) + + init(_CONF) old_state = get_state() logger.info('Initial State: %s', old_state) telegram.send_msg('*Status:* `{}`'.format(old_state.name.lower())) @@ -278,17 +284,5 @@ def app(config: dict) -> None: old_state = new_state -def main(): - """ - Loads and validates the config and starts the main loop - :return: None - """ - global _CONF - with open('config.json') as file: - _CONF = json.load(file) - validate(_CONF, CONF_SCHEMA) - app(_CONF) - - if __name__ == '__main__': main()