aboutsummaryrefslogtreecommitdiff
path: root/src/command.py
diff options
context:
space:
mode:
authortassaron2017-08-28 18:54:54 -0400
committertassaron2017-08-28 18:54:54 -0400
commit8411857030d92e448d5c64682f396e677161afbe (patch)
tree2dc5e033a4073d433aaa824113467032d35ca3c1 /src/command.py
parentad6dd9f5329f3e23e75c181c21ca8701028b538f (diff)
ctrl-c ends commandline mode properly
Diffstat (limited to 'src/command.py')
-rw-r--r--src/command.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/command.py b/src/command.py
index 4116c5a..cd3c6c3 100644
--- a/src/command.py
+++ b/src/command.py
@@ -8,6 +8,7 @@ import argparse
import os
import sys
import time
+import signal
from core import Core
@@ -91,6 +92,9 @@ class Command(QtCore.QObject):
for arg in args:
self.core.selectedComponents[i].command(arg)
+ # ctrl-c stops the export thread
+ signal.signal(signal.SIGINT, self.stopVideo)
+
if self.args.export and self.args.projpath:
errcode, data = self.core.parseAvFile(projPath)
for key, value in data['WindowFields']:
@@ -124,6 +128,11 @@ class Command(QtCore.QObject):
self.worker.progressBarSetText.connect(self.progressBarSetText)
self.createVideo.emit()
+ def stopVideo(self, *args):
+ self.worker.error = True
+ self.worker.cancelExport()
+ self.worker.cancel()
+
@QtCore.pyqtSlot(str)
def progressBarSetText(self, value):
if 'Export ' in value: