[Spambayes-checkins] spambayes/Outlook2000 addin.py, 1.151, 1.152 manager.py, 1.108, 1.109

Tony Meyer anadelonbrin at users.sourceforge.net
Fri Apr 22 08:18:14 CEST 2005


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

Modified Files:
	addin.py manager.py 
Log Message:
Replace assert type(x), type() with assert isinstance(x, types.X)

Index: addin.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v
retrieving revision 1.151
retrieving revision 1.152
diff -C2 -d -r1.151 -r1.152
*** addin.py	10 Jan 2005 22:17:38 -0000	1.151
--- addin.py	22 Apr 2005 06:18:09 -0000	1.152
***************
*** 1,4 ****
--- 1,5 ----
  # SpamBayes Outlook Addin
  import sys, os
+ import types
  import warnings
  import traceback
***************
*** 289,293 ****
          if use_timer:
              too = None
!             if type(start_delay) != type(0.0) or type(interval) != type(0.0):
                  print "*" * 50
                  print "Timer values are garbage!", repr(start_delay), repr(interval)
--- 290,295 ----
          if use_timer:
              too = None
!             if not isinstance(start_delay, types.FloatType) or \
!                not isinstance(interval, types.FloatType):
                  print "*" * 50
                  print "Timer values are garbage!", repr(start_delay), repr(interval)
***************
*** 321,325 ****
          assert thread.get_ident() == self.owner_thread_ident
          assert self.timer_id is None, "Shouldn't start a timer when already have one"
!         assert type(delay)==type(0.0), "Timer values are float seconds"
          # And start a new timer.
          assert delay, "No delay means no timer!"
--- 323,327 ----
          assert thread.get_ident() == self.owner_thread_ident
          assert self.timer_id is None, "Shouldn't start a timer when already have one"
!         assert isinstance(delay, types.FloatType), "Timer values are float seconds"
          # And start a new timer.
          assert delay, "No delay means no timer!"

Index: manager.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/manager.py,v
retrieving revision 1.108
retrieving revision 1.109
diff -C2 -d -r1.108 -r1.109
*** manager.py	7 Apr 2005 04:18:19 -0000	1.108
--- manager.py	22 Apr 2005 06:18:09 -0000	1.109
***************
*** 5,8 ****
--- 5,9 ----
  import sys
  import errno
+ import types
  import shutil
  import traceback
***************
*** 396,400 ****
              except AttributeError: # May already be Unicode
                  pass
!             assert type(value) == type(u''), "%r should be a unicode" % value
              try:
                  if not os.path.isdir(value):
--- 397,401 ----
              except AttributeError: # May already be Unicode
                  pass
!             assert isinstance(value, types.UnicodeType), "%r should be a unicode" % value
              try:
                  if not os.path.isdir(value):
***************
*** 941,950 ****
          delay = self.config.notification.notify_accumulate_delay
          self._DoStartNotifyTimer(delay)
-         pass
          
      def _DoStartNotifyTimer(self, delay):
          assert thread.get_ident() == self.owner_thread_ident
          assert self.notify_timer_id is None, "Shouldn't start a timer when already have one"
!         assert type(delay)==type(0.0), "Timer values are float seconds"
          # And start a new timer.
          assert delay, "No delay means no timer!"
--- 942,950 ----
          delay = self.config.notification.notify_accumulate_delay
          self._DoStartNotifyTimer(delay)
          
      def _DoStartNotifyTimer(self, delay):
          assert thread.get_ident() == self.owner_thread_ident
          assert self.notify_timer_id is None, "Shouldn't start a timer when already have one"
!         assert isinstance(delay, types.FloatType), "Timer values are float seconds"
          # And start a new timer.
          assert delay, "No delay means no timer!"



More information about the Spambayes-checkins mailing list