How to use the vorta.application.VortaApp function in vorta

To help you get started, we’ve selected a few vorta examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github borgbase / vorta / tests / fixtures.py View on Github external
def app(tmpdir):
    tmp_db = tmpdir.join('settings.sqlite')
    mock_db = peewee.SqliteDatabase(str(tmp_db))
    vorta.models.init_db(mock_db)
    return VortaApp([])
github borgbase / vorta / src / vorta / __main__.py View on Github external
# We assume that a frozen binary is a fat single-file binary made with
    # PyInstaller. These are not compatible with forking into background here:
    if not (want_foreground or frozen_binary):
        if os.fork():
            sys.exit()

    init_logger(foreground=want_foreground)

    # Init database
    sqlite_db = peewee.SqliteDatabase(os.path.join(SETTINGS_DIR, 'settings.db'))
    init_db(sqlite_db)

    # Init app after database is available
    from vorta.application import VortaApp
    app = VortaApp(sys.argv, single_app=True)
    app.updater = get_updater()

    # Force fusion style on Linux
    if sys.platform.startswith('linux'):
        app.setStyle('Fusion')

    sys.exit(app.exec_())
github borgbase / vorta / src / vorta / __main__.py View on Github external
# We assume that a frozen binary is a fat single-file binary made with
    # PyInstaller. These are not compatible with forking into background here:
    if not (want_foreground or frozen_binary):
        if os.fork():
            sys.exit()

    init_logger(foreground=want_foreground)

    # Init database
    sqlite_db = peewee.SqliteDatabase(os.path.join(SETTINGS_DIR, 'settings.db'))
    init_db(sqlite_db)

    # Init app after database is available
    from vorta.application import VortaApp
    app = VortaApp(sys.argv, single_app=True)
    app.updater = get_updater()

    sys.exit(app.exec_())