Handles Ctrl+C and sigint to close data file before quitting

This commit is contained in:
Abhay Rana 2013-12-01 17:52:59 +05:30
parent 0e2d49f811
commit 4a604c1527
1 changed files with 2 additions and 0 deletions

View File

@ -9,6 +9,7 @@ import webbrowser
import json
import argparse
from os.path import expanduser
import signal
try:
import appindicator
@ -84,6 +85,7 @@ class HackerNewsApp:
gtk.main_quit()
def run(self):
signal.signal(signal.SIGINT, self.quit)
gtk.main()
return 0