[Spambayes-checkins] spambayes/windows pop3proxy_service.py, 1.15, 1.16 pop3proxy_tray.py, 1.16, 1.17

Mark Hammond mhammond at users.sourceforge.net
Sat Dec 13 20:30:51 EST 2003


Update of /cvsroot/spambayes/spambayes/windows
In directory sc8-pr-cvs1:/tmp/cvs-serv15075/windows

Modified Files:
	pop3proxy_service.py pop3proxy_tray.py 
Log Message:
Fix [ 859215 ] "Restore Defaults" causes assertion error at exit.
There was some confusion between the global 'state' and local state passed
to the global sb_server functions.  This meant that even when a state was
recreated during run(), the old state was closed as run() finished.
The global sb_server methods now all use the global sb_server state - if
you need finer state control, use your own state but don't call the global
sb_server functions.


Index: pop3proxy_service.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/windows/pop3proxy_service.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** pop3proxy_service.py	29 Sep 2003 02:18:27 -0000	1.15
--- pop3proxy_service.py	14 Dec 2003 01:30:49 -0000	1.16
***************
*** 102,106 ****
          self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
          self.event_stopping.set()
!         sb_server.stop(sb_server.state)        
  
      def SvcDoRun(self):
--- 102,106 ----
          self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
          self.event_stopping.set()
!         sb_server.stop()        
  
      def SvcDoRun(self):
***************
*** 108,112 ****
          # Setup our state etc
          try:
!             sb_server.prepare(state=sb_server.state)
          except sb_server.AlreadyRunningException:
              msg = "The SpamBayes proxy service could not be started, as "\
--- 108,112 ----
          # Setup our state etc
          try:
!             sb_server.prepare()
          except sb_server.AlreadyRunningException:
              msg = "The SpamBayes proxy service could not be started, as "\
***************
*** 169,173 ****
          try:
              try:
!                 sb_server.start(sb_server.state)
              except SystemExit:
                  # user requested shutdown
--- 169,173 ----
          try:
              try:
!                 sb_server.start()
              except SystemExit:
                  # user requested shutdown

Index: pop3proxy_tray.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/windows/pop3proxy_tray.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** pop3proxy_tray.py	4 Dec 2003 02:57:43 -0000	1.16
--- pop3proxy_tray.py	14 Dec 2003 01:30:49 -0000	1.17
***************
*** 392,396 ****
          if self.started and not self.use_service:
              try:
!                 sb_server.stop(sb_server.state)
              except:
                  print "Error stopping proxy at shutdown"
--- 392,396 ----
          if self.started and not self.use_service:
              try:
!                 sb_server.stop()
              except:
                  print "Error stopping proxy at shutdown"
***************
*** 405,409 ****
          self.started = True
          try:
!             sb_server.start(sb_server.state)
          finally:
              self.started = False
--- 405,409 ----
          self.started = True
          try:
!             sb_server.start()
          finally:
              self.started = False
***************
*** 429,433 ****
              if not self.have_prepared_state:
                  try:
!                     sb_server.prepare(state=sb_server.state)
                      self.have_prepared_state = True
                  except sb_server.AlreadyRunningException:
--- 429,433 ----
              if not self.have_prepared_state:
                  try:
!                     sb_server.prepare()
                      self.have_prepared_state = True
                  except sb_server.AlreadyRunningException:
***************
*** 461,465 ****
              if not use_service:
                  if verbose: print "Stopping local server"
!                 sb_server.stop(sb_server.state)
          except:
              print "There was an error stopping the server"
--- 461,465 ----
              if not use_service:
                  if verbose: print "Stopping local server"
!                 sb_server.stop()
          except:
              print "There was an error stopping the server"





More information about the Spambayes-checkins mailing list