Catch Keyboard interrupt when running in foreground mode. Fixes #204

This commit is contained in:
Manuel Riel 2019-02-26 20:00:06 +08:00 committed by GitHub
parent 79b5847460
commit 7487c40ec6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -1,6 +1,7 @@
import sys
import os
import peewee
import signal
from vorta.models import init_db
from vorta.config import SETTINGS_DIR
@ -11,6 +12,7 @@ from vorta.log import init_logger
def main():
args = parse_args()
signal.signal(signal.SIGINT, signal.SIG_DFL) # catch ctrl-c and exit
frozen_binary = getattr(sys, 'frozen', False)
want_foreground = getattr(args, 'foreground', False)