[Spambayes-checkins] spambayes pop3proxy.py,1.27,1.28

Tim Stone timstone4@users.sourceforge.net
Thu Nov 28 16:35:59 2002


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

Modified Files:
	pop3proxy.py 
Log Message:
Changed startup messages to be a bit more informative.

Made writing of log file dependent on options.verbose

Index: pop3proxy.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/pop3proxy.py,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** pop3proxy.py	28 Nov 2002 16:10:46 -0000	1.27
--- pop3proxy.py	28 Nov 2002 16:35:57 -0000	1.28
***************
*** 29,33 ****
  
  For safety, and to help debugging, the whole POP3 conversation is
! written out to _pop3proxy.log for each run.
  
  To make rebuilding the database easier, uploaded messages are appended
--- 29,33 ----
  
  For safety, and to help debugging, the whole POP3 conversation is
! written out to _pop3proxy.log for each run, if options.verbose is True.
  
  To make rebuilding the database easier, uploaded messages are appended
***************
*** 166,170 ****
          self.set_socket(s, socketMap)
          self.set_reuse_addr()
!         print "%s listening on port %d." % (self.__class__.__name__, port)
          self.bind(('', port))
          self.listen(5)
--- 166,171 ----
          self.set_socket(s, socketMap)
          self.set_reuse_addr()
!         if options.verbose:
!             print "%s listening on port %d." % (self.__class__.__name__, port)
          self.bind(('', port))
          self.listen(5)
***************
*** 389,392 ****
--- 390,394 ----
          proxyArgs = (serverName, serverPort)
          Listener.__init__(self, proxyPort, BayesProxy, proxyArgs)
+         print 'Listener on port %d is proxying %s:%d' % (proxyPort, serverName, serverPort)
  
  
***************
*** 429,434 ****
      def send(self, data):
          """Logs the data to the log file."""
!         state.logFile.write(data)
!         state.logFile.flush()
          try:
              return POP3ProxyBase.send(self, data)
--- 431,437 ----
      def send(self, data):
          """Logs the data to the log file."""
!         if options.verbose:
!             state.logFile.write(data)
!             state.logFile.flush()
          try:
              return POP3ProxyBase.send(self, data)
***************
*** 442,447 ****
          """Logs the data to the log file."""
          data = POP3ProxyBase.recv(self, size)
!         state.logFile.write(data)
!         state.logFile.flush()
          return data
  
--- 445,451 ----
          """Logs the data to the log file."""
          data = POP3ProxyBase.recv(self, size)
!         if options.verbose:
!             state.logFile.write(data)
!             state.logFile.flush()
          return data
  
***************
*** 565,568 ****
--- 569,573 ----
      def __init__(self, uiPort, socketMap=asyncore.socket_map):
          Listener.__init__(self, uiPort, UserInterface, (), socketMap=socketMap)
+         print 'User interface url is http://localhost:%d' % (uiPort)
  
  
***************
*** 1215,1219 ****
          __main__ code below."""
          # Open the log file.
!         self.logFile = open('_pop3proxy.log', 'wb', 0)
  
          # Load up the old proxy settings from Options.py / bayescustomize.ini
--- 1220,1225 ----
          __main__ code below."""
          # Open the log file.
!         if options.verbose:
!             self.logFile = open('_pop3proxy.log', 'wb', 0)
  
          # Load up the old proxy settings from Options.py / bayescustomize.ini





More information about the Spambayes-checkins mailing list