[Spambayes-checkins] spambayes/Outlook2000 msgstore.py, 1.60, 1.61 filter.py, 1.27, 1.28

Mark Hammond mhammond at users.sourceforge.net
Thu Jul 31 06:30:03 EDT 2003


Update of /cvsroot/spambayes/spambayes/Outlook2000
In directory sc8-pr-cvs1:/tmp/cvs-serv4180

Modified Files:
	msgstore.py filter.py 
Log Message:
Fix [ 780801 ] IMAP Still Failing - GetField() returns None on MAPI error
(no idea why it does, but I'm not sure I care) and stupid error in
exception handler.


Index: msgstore.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/msgstore.py,v
retrieving revision 1.60
retrieving revision 1.61
diff -C2 -d -r1.60 -r1.61
*** msgstore.py	30 Jul 2003 03:20:13 -0000	1.60
--- msgstore.py	31 Jul 2003 12:30:00 -0000	1.61
***************
*** 830,834 ****
          self.dirty = True
  
!     def GetField(self, prop):
          self._EnsureObject()
          if type(prop) != type(0):
--- 830,834 ----
          self.dirty = True
  
!     def GetField(self, prop, raise_errors = False):
          self._EnsureObject()
          if type(prop) != type(0):
***************
*** 838,849 ****
                  return None
              prop = PROP_TAG( PT_UNSPECIFIED, PROP_ID(prop))
!         hr, props = self.mapi_object.GetProps((prop,), 0)
!         ((tag, val), ) = props
!         if PROP_TYPE(tag) == PT_ERROR:
!             if val == mapi.MAPI_E_NOT_ENOUGH_MEMORY:
!                 # Too big for simple properties - get via a stream
!                 return self._GetPropFromStream(prop)
              return None
-         return val
  
      def GetReadState(self):
--- 838,854 ----
                  return None
              prop = PROP_TAG( PT_UNSPECIFIED, PROP_ID(prop))
!         try:
!             hr, props = self.mapi_object.GetProps((prop,), 0)
!             ((tag, val), ) = props
!             if PROP_TYPE(tag) == PT_ERROR:
!                 if val == mapi.MAPI_E_NOT_ENOUGH_MEMORY:
!                     # Too big for simple properties - get via a stream
!                     return self._GetPropFromStream(prop)
!                 return None
!             return val
!         except:
!             if raise_errors:
!                 raise
              return None
  
      def GetReadState(self):

Index: filter.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/filter.py,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** filter.py	20 Jul 2003 13:37:00 -0000	1.27
--- filter.py	31 Jul 2003 12:30:00 -0000	1.28
***************
*** 43,47 ****
                      msg.RememberMessageCurrentFolder()
                  msg.Save()
!         except pythoncom.com_error, (hr, msg, exc, arg_err):
              # This seems to happen for IMAP mails (0x800cccd3)
              # and also for hotmail messages (0x8004dff7)
--- 43,47 ----
                      msg.RememberMessageCurrentFolder()
                  msg.Save()
!         except pythoncom.com_error, (hr, exc_msg, exc, arg_err):
              # This seems to happen for IMAP mails (0x800cccd3)
              # and also for hotmail messages (0x8004dff7)
***************
*** 50,54 ****
              if hr not in known_failure_codes:
                  print "Unexpected MAPI error saving the spam score for", msg
!                 print hr, msg, exc
              else:
                  # So we can see if it still happens :)
--- 50,54 ----
              if hr not in known_failure_codes:
                  print "Unexpected MAPI error saving the spam score for", msg
!                 print hr, exc_msg, exc
              else:
                  # So we can see if it still happens :)





More information about the Spambayes-checkins mailing list