From 12908c01c508dd7bd31f5c54762167a768dfdbb1 Mon Sep 17 00:00:00 2001 From: Christophe Benz Date: Mon, 12 Apr 2010 16:57:01 +0200 Subject: [PATCH] display nice message on SIGINT --- weboob/tools/application/base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/weboob/tools/application/base.py b/weboob/tools/application/base.py index 598b4965..c29dc550 100644 --- a/weboob/tools/application/base.py +++ b/weboob/tools/application/base.py @@ -104,4 +104,7 @@ class BaseApplication(object): level = logging.WARNING log_format = '%(asctime)s:%(levelname)s:%(filename)s:%(lineno)d %(message)s' logging.basicConfig(stream=sys.stdout, level=level, format=log_format) - sys.exit(app.main(args)) + try: + sys.exit(app.main(args)) + except KeyboardInterrupt: + print 'Program killed by SIGINT'