From c565956ace933d10321535291a62a0eb14d8bf37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BF=D0=B8=D1=80=D0=B8=D0=B4=D0=BE=D0=BD=D0=BE?= =?UTF-8?q?=D0=B2=20=D0=94=D0=B5=D0=BD=D0=B8=D1=81?= Date: Mon, 2 Jul 2012 13:25:50 +0400 Subject: [PATCH] fix stop wait_thread --- console/application/cl_client.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/console/application/cl_client.py b/console/application/cl_client.py index 42e366c..00f81af 100644 --- a/console/application/cl_client.py +++ b/console/application/cl_client.py @@ -356,7 +356,6 @@ def main(wait_thread): url = "https://%s:%d/?wsdl" %(host, port) clear() - serv_hostname = get_server_hostname(host, path_to_cert) get_name_flag = False if serv_hostname: @@ -392,6 +391,10 @@ def main(wait_thread): clVarsCore, wait_thread) except urllib2.URLError, e: print _('Error: '), e + except KeyboardInterrupt: + wait_thread.stop() + red = '\n'+'\033[31m * \033[0m' + print red + _('Interrupted by the user') except Exception, e: wait_thread.stop() if type(e.message) != int: @@ -408,6 +411,10 @@ def main(wait_thread): _print (f.fault) except TransportError, te: print _("Exception: %s") %te + except KeyboardInterrupt: + wait_thread.stop() + red = '\n'+'\033[31m * \033[0m' + print red + _('Interrupted by the user') except Exception, e: print _("Exception: %s") %e tb.print_exc() @@ -425,6 +432,10 @@ def main(wait_thread): wait_thread.stop() print '\b' + _('Failed to connect')+':', e return 1 + except KeyboardInterrupt: + wait_thread.stop() + red = '\n'+'\033[31m * \033[0m' + print red + _('Interrupted by the user') try: import glob @@ -482,6 +493,10 @@ def main(wait_thread): clVarsCore, wait_thread) except urllib2.URLError, e: print _('Error: '), e + except KeyboardInterrupt: + wait_thread.stop() + red = '\n'+'\033[31m * \033[0m' + print red + _('Interrupted by the user') except Exception, e: wait_thread.stop() if type(e.message) != int: @@ -499,6 +514,10 @@ def main(wait_thread): _print (f.fault) except TransportError, te: print _("Exception: %s") %te + except KeyboardInterrupt: + wait_thread.stop() + red = '\n'+'\033[31m * \033[0m' + print red + _('Interrupted by the user') except Exception, e: print _("Exception: %s") %e tb.print_exc()