[Spambayes-checkins] spambayes/Outlook2000 manager.py,1.64,1.65

Mark Hammond mhammond at users.sourceforge.net
Sun Jul 20 07:31:16 EDT 2003


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

Modified Files:
	manager.py 
Log Message:
Minor cleanups:
* Log message had strings back to front
* Migrating pickle catches all errors rather than just IOError.
* Assert we have a config before we attempt to use it!


Index: manager.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/manager.py,v
retrieving revision 1.64
retrieving revision 1.65
diff -C2 -d -r1.64 -r1.65
*** manager.py	8 Jul 2003 11:26:11 -0000	1.64
--- manager.py	20 Jul 2003 13:31:13 -0000	1.65
***************
*** 367,372 ****
              
          folder = msgstore_folder.GetOutlookItem()
!         self.LogDebug(2, "Checking folder '%s' for our field '%s'" \
!                   % (self.config.general.field_score_name,folder.Name.encode("mbcs", "replace")))
          items = folder.Items
          item = items.GetFirst()
--- 367,372 ----
              
          folder = msgstore_folder.GetOutlookItem()
!         self.LogDebug(2, "Checking folder '%s' for field '%s'" \
!                   % (folder.Name.encode("mbcs", "replace"), self.config.general.field_score_name))
          items = folder.Items
          item = items.GetFirst()
***************
*** 516,522 ****
              try:
                  old_config = cPickle.load(f)
!             except IOError, details:
                  print "FAILED to load old pickle"
!                 print details
                  msg = "There was an error loading your old\r\n" \
                        "SpamBayes configuration file.\r\n\r\n" \
--- 516,522 ----
              try:
                  old_config = cPickle.load(f)
!             except:
                  print "FAILED to load old pickle"
!                 traceback.print_exc()
                  msg = "There was an error loading your old\r\n" \
                        "SpamBayes configuration file.\r\n\r\n" \
***************
*** 602,608 ****
      def SaveConfig(self):
          print "Saving configuration ->", self.config_filename
          if self.verbose > 1:
              self.options.display()
-         assert self.config and self.options, "Have no config to save!"
          self.options.update_file(self.config_filename)
  
--- 602,608 ----
      def SaveConfig(self):
          print "Saving configuration ->", self.config_filename
+         assert self.config and self.options, "Have no config to save!"
          if self.verbose > 1:
              self.options.display()
          self.options.update_file(self.config_filename)
  





More information about the Spambayes-checkins mailing list