]> sigrok.org Git - sigrok-meter.git/commitdiff
Enable killing of the program with CTRL+C.
authorJens Steinhauser <redacted>
Sun, 27 Sep 2015 12:42:58 +0000 (14:42 +0200)
committerJens Steinhauser <redacted>
Sun, 27 Sep 2015 12:42:58 +0000 (14:42 +0200)
sigrok-meter

index dc34745445d63f9efc7642726154f73d2d767b65..4722feba8d2245cbb265b3089b5b89e0057ee7b8 100755 (executable)
@@ -24,6 +24,7 @@ import argparse
 import sigrok.core as sr
 import sys
 import textwrap
+import signal
 
 default_drivers = [('demo:analog_channels=4', 'samplerate=4')]
 default_loglevel = 2
@@ -87,6 +88,8 @@ def parse_cli():
     return args
 
 if __name__ == '__main__':
+    signal.signal(signal.SIGINT, signal.SIG_DFL)
+
     args = parse_cli()
 
     import qtcompat