tools/scyllatop: leave terminal in a functioning state when user quits with CTRL-C

closes issue #1417.

Signed-off-by: Yoav Kleinberger <yoav@scylladb.com>
Message-Id: <1467556769-11851-1-git-send-email-yoav@scylladb.com>
This commit is contained in:
Yoav Kleinberger
2016-07-03 17:39:29 +03:00
committed by Avi Kivity
parent 386c0dd4b2
commit 49cba035ea

View File

@@ -14,12 +14,6 @@ import signal
import urwid
def halt(* args):
quit()
signal.signal(signal.SIGINT, halt)
def shell():
try:
import IPython
@@ -41,7 +35,10 @@ def main(metricPatterns, interval, collectd):
liveDataThread = threading.Thread(target=lambda: liveData.go(loop))
liveDataThread.daemon = True
liveDataThread.start()
loop.run()
try:
loop.run()
except KeyboardInterrupt:
pass
if __name__ == '__main__':
description = '\n'.join(['A top-like tool for scylladb collectd metrics.',