Initializes the application
()
| 15 | from behaviour import Behaviour |
| 16 | |
| 17 | def main(): |
| 18 | """Initializes the application |
| 19 | """ |
| 20 | # Load settings and create the config object |
| 21 | config = Configuration() |
| 22 | settings = config.settings |
| 23 | |
| 24 | # Set up logger |
| 25 | logs.configure_logging(settings['log_level'], settings['log_mode']) |
| 26 | logger = structlog.get_logger() |
| 27 | |
| 28 | # Configure and run configured behaviour. |
| 29 | exchange_interface = ExchangeInterface(config.exchanges) |
| 30 | notifier = Notifier(config.notifiers) |
| 31 | |
| 32 | behaviour = Behaviour( |
| 33 | config, |
| 34 | exchange_interface, |
| 35 | notifier |
| 36 | ) |
| 37 | |
| 38 | while True: |
| 39 | behaviour.run(settings['market_pairs'], settings['output_mode']) |
| 40 | logger.info("Sleeping for %s seconds", settings['update_interval']) |
| 41 | time.sleep(settings['update_interval']) |
| 42 | |
| 43 | if __name__ == "__main__": |
| 44 | try: |
no test coverage detected