spambayes/scripts sb_server.py,1.43,1.44

"Tony Meyer" <[email protected]>
Newsgroups gmane.mail.spam.spambayes.cvs
Message-ID <[email protected]>
Update of /cvsroot/spambayes/spambayes/scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24212/scripts

Modified Files:
	sb_server.py 
Log Message:
Fix [ 1176998 ] sb_server ignores parameter -l

The -l parameter didn't work, as outlined in the tracker.  Also improved it to handle
 multiple port numbers (separated with commas) so it can be used even with multiple
 servers.

Not sure if we really need this option (-o pop3proxy:listen_ports:port_number would
 do the same thing), but since it's there it might as well work!

Index: sb_server.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/scripts/sb_server.py,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -d -r1.43 -r1.44
*** sb_server.py	6 Apr 2005 02:49:23 -0000	1.43
--- sb_server.py	6 Apr 2005 04:06:36 -0000	1.44
***************
*** 741,745 ****
  
          self.servers = []
-         self.proxyPorts = []
          if options["pop3proxy", "remote_servers"]:
              for server in options["pop3proxy", "remote_servers"]:
--- 741,744 ----
***************
*** 751,757 ****
                  self.servers.append((server, int(port)))
  
!         if options["pop3proxy", "listen_ports"]:
!             splitPorts = options["pop3proxy", "listen_ports"]
!             self.proxyPorts = map(_addressAndPort, splitPorts)
  
          if len(self.servers) != len(self.proxyPorts):
--- 750,759 ----
                  self.servers.append((server, int(port)))
  
!         if not hasattr(self, "proxyPorts"):
!             # Could have already been set via the command line.
!             self.proxyPorts = []
!             if options["pop3proxy", "listen_ports"]:
!                 splitPorts = options["pop3proxy", "listen_ports"]
!                 self.proxyPorts = map(_addressAndPort, splitPorts)
  
          if len(self.servers) != len(self.proxyPorts):
***************
*** 1054,1058 ****
          # below, in case you are wondering why they are missing.
          elif opt == '-l':
!             state.proxyPorts = [_addressAndPort(arg)]
          elif opt == '-u':
              state.uiPort = int(arg)
--- 1056,1060 ----
          # below, in case you are wondering why they are missing.
          elif opt == '-l':
!             state.proxyPorts = [_addressAndPort(a) for a in arg.split(',')]
          elif opt == '-u':
              state.uiPort = int(arg)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.