Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def app(tmpdir):
tmp_db = tmpdir.join('settings.sqlite')
mock_db = peewee.SqliteDatabase(str(tmp_db))
vorta.models.init_db(mock_db)
return VortaApp([])
if want_version:
print(f"Vorta {__version__}")
sys.exit()
# 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_())
if want_version:
print(f"Vorta {__version__}")
sys.exit()
# 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_())