changeset 520:1ebd38ababc9

put an exception around: do_pop user and password entry to catch ctrl-c/d.
author Engelbert Gruber <grubert@users.sourceforge.net>
date Fri, 11 Jan 2002 07:02:29 +0000
parents 2dd8571ca738
children 1416195a830d
files roundup-mailgw
diffstat 1 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/roundup-mailgw	Fri Jan 11 03:34:52 2002 +0000
+++ b/roundup-mailgw	Fri Jan 11 07:02:29 2002 +0000
@@ -16,7 +16,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: roundup-mailgw,v 1.20 2002-01-07 10:43:48 richard Exp $
+# $Id: roundup-mailgw,v 1.21 2002-01-11 07:02:29 grubert Exp $
 
 # python version check
 from roundup import version_check
@@ -64,10 +64,15 @@
     '''Read a series of messages from the specified POP server.
     '''
     import getpass, poplib, socket
-    if not user:
-        user = raw_input(_('User: '))
-    if not password:
-        password = getpass.getpass()
+    try:
+        if not user:
+            user = raw_input(_('User: '))
+        if not password:
+            password = getpass.getpass()
+    except (KeyboardInterrupt, EOFError):
+        # Ctrl C or D maybe also Ctrl Z under Windows.
+        print "\nAborted by user."
+        return 1
 
     # open a connection to the server and retrieve all messages
     try:
@@ -173,6 +178,9 @@
 
 #
 # $Log: not supported by cvs2svn $
+# Revision 1.20  2002/01/07 10:43:48  richard
+# #500329 ] exception on server not reachable-patch
+#
 # Revision 1.19  2002/01/05 02:19:03  richard
 # i18n'ification
 #

Roundup Issue Tracker: http://roundup-tracker.org/