[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[minion-cvs] Detects if the port numbers are ... not numbers.



Update of /home/minion/cvsroot/src/minion/etc
In directory moria.mit.edu:/tmp/cvs-serv11499

Modified Files:
	minionProxy.py 
Log Message:
Detects if the port numbers are ... not numbers.



Index: minionProxy.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/etc/minionProxy.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- minionProxy.py	5 Mar 2004 18:28:56 -0000	1.2
+++ minionProxy.py	8 Mar 2004 16:53:32 -0000	1.3
@@ -68,11 +68,19 @@
         if opt in ('-H', '--host'):
             imap_address = arg
         elif opt in ('-I', '--imapport'):
-            imap_port = int(arg)
+            try:
+                imap_port = int(arg)
+            except ValueError:
+                print 'POP3 port is not a number'
+                pass
         elif opt in ('-L', '--localhost'):
             local_host = arg
         elif opt in ('-S', '--smtlport'):
-            imap_port = int(arg)
+            try:
+                imap_port = int(arg)
+            except:
+                print 'SMTP port is not a number'
+                pass
         elif opt in ('-h', '--help'):
             print __doc__
             sys.exit(0)
@@ -89,4 +97,5 @@
     try:
         asyncore.loop()
     except KeyboardInterupt:
+        print 'Bye...'
         pass