[Spambayes-checkins] spambayes/spambayes ImapUI.py,1.36,1.36.4.1

Tony Meyer anadelonbrin at users.sourceforge.net
Fri Oct 15 08:03:36 CEST 2004


Update of /cvsroot/spambayes/spambayes/spambayes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20592/spambayes

Modified Files:
      Tag: release_1_0-branch
	ImapUI.py 
Log Message:
Backport fix for displaying error when trying to display IMAP folder names and not
 having sufficient information.

Index: ImapUI.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/ImapUI.py,v
retrieving revision 1.36
retrieving revision 1.36.4.1
diff -C2 -d -r1.36 -r1.36.4.1
*** ImapUI.py	27 Jan 2004 08:37:14 -0000	1.36
--- ImapUI.py	15 Oct 2004 06:03:29 -0000	1.36.4.1
***************
*** 44,47 ****
--- 44,48 ----
  import re
  import cgi
+ import types
  
  import UserInterface
***************
*** 202,205 ****
--- 203,213 ----
                      port = 143
              self.imap = self.imap_session_class(server, port)
+             if not self.imap.connected:
+               # Failed to connect.
+               content = self._buildBox("Error", None,
+                                        "Please check server/port details.")
+               self.write(content)
+               self._writePostamble()
+               return
          if self.imap is None:
              content = self._buildBox("Error", None,
***************
*** 208,213 ****
              self._writePostamble()
              return
!         username = options["imap", "username"][0]
!         if username == "":
              content = self._buildBox("Error", None,
                                       """Must specify username first.""")
--- 216,223 ----
              self._writePostamble()
              return
!         username = options["imap", "username"]
!         if isinstance(username, types.TupleType):
!             username = username[0]
!         if not username:
              content = self._buildBox("Error", None,
                                       """Must specify username first.""")
***************
*** 215,218 ****
--- 225,238 ----
              self._writePostamble()
              return
+         if not self.imap_pwd:
+             self.imap_pwd = options["imap", "password"]
+             if isinstance(self.imap_pwd, types.TupleType):
+                 self.imap_pwd = self.imap_pwd[0]
+         if not self.imap_pwd:
+             content = self._buildBox("Error", None,
+                                      """Must specify password first.""")
+             self.write(content)
+             self._writePostamble()
+             return
          self.imap.login(username, self.imap_pwd)
          self.imap_logged_in = True



More information about the Spambayes-checkins mailing list