Beispiel #1
0
def main():
    app = QApplication([])

    # This must be done after the application is instantiated.
    locale = QLocale(QLocale.C)
    locale.setNumberOptions(QLocale.OmitGroupSeparator)
    QLocale.setDefault(locale)

    config = Config()
    config.removeOldFiles()

    setUpLoggers()

    logger.info("Starting the application.")
    window = MainWindow()
    window.show()
    logger.info("Ready.")

    sys.exit(app.exec_())
Beispiel #2
0
def main():
    setUpLoggers()

    app = QApplication([])

    # This must be done after the application is instantiated.
    locale = QLocale(QLocale.C)
    locale.setNumberOptions(QLocale.OmitGroupSeparator)
    QLocale.setDefault(locale)

    config = Config()
    config.removeOldFiles()
    settings = config.read()
    # Set default values if the config file is empty or was not created.
    if not settings.allKeys():
        logger.debug("Loading default settings.")
        config.loadDefaults()

    logger.info("Starting the application.")
    window = MainWindow()
    window.show()
    logger.info("Ready.")

    sys.exit(app.exec_())