#!/usr/bin/python3 -Es
import sys
from gonha.mainwindow import MainWindow
from gonha.util import Config
import coloredlogs
import logging
import os

if __name__ == '__main__':
    os.environ['QT_LOGGING_RULES'] = "qt5ct.debug=false"
    logger = logging.getLogger(__name__)
    coloredlogs.install()
    config = Config()
    logger.info(f':: Gonha - {config.getVersion()} ::')
    if len(sys.argv) > 1:
        if sys.argv[1] == '--config':
            logger.info('Entering config mode...')
            config.wizard()
    else:
        app = MainWindow.app
        window = MainWindow()
        app.exec_()
