[Spambayes-checkins] spambayes/scripts sb_server.py,1.25,1.26

Tony Meyer anadelonbrin at users.sourceforge.net
Tue Aug 3 08:51:55 CEST 2004


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

Modified Files:
	sb_server.py 
Log Message:
Implement [ 909088 ] remove STLS pop3 capability

Remove STLS like we remove PIPELINING, using Richie's suggested code.
Also update the test.

Also clean up the getopt stuff, and add a couple of clarifying comments.

Index: sb_server.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/scripts/sb_server.py,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** sb_server.py	19 Jul 2004 09:57:07 -0000	1.25
--- sb_server.py	3 Aug 2004 06:51:53 -0000	1.26
***************
*** 303,311 ****
  
      def onResponse(self):
!         # We don't support pipelining, so if the command is CAPA and the
!         # response includes PIPELINING, hack out that line of the response.
!         if self.command == 'CAPA':
!             pipelineRE = r'(?im)^PIPELINING[^\n]*\n'
!             self.response = re.sub(pipelineRE, '', self.response)
  
          # Pass the request and the raw response to the subclass and
--- 303,312 ----
  
      def onResponse(self):
!         # There are some features, tested by clients using CAPA,
!         # that we don't support.  We strip them from the CAPA
!         # response here, so that the client won't use them.
!         for unsupported in ['PIPELINING', 'STLS', ]:
!             unsupportedLine = r'(?im)^%s[^\n]*\n' % (unsupported,)
!             self.response = re.sub(unsupportedLine, '', self.response)
  
          # Pass the request and the raw response to the subclass and
***************
*** 916,920 ****
      # Read the arguments.
      try:
!         opts, args = getopt.getopt(sys.argv[1:], 'hbpsd:p:l:u:o:')
      except getopt.error, msg:
          print >>sys.stderr, str(msg) + '\n\n' + __doc__
--- 917,921 ----
      # Read the arguments.
      try:
!         opts, args = getopt.getopt(sys.argv[1:], 'hbd:p:l:u:o:')
      except getopt.error, msg:
          print >>sys.stderr, str(msg) + '\n\n' + __doc__
***************
*** 928,931 ****
--- 929,934 ----
          elif opt == '-b':
              state.launchUI = True
+         # '-p' and '-d' are handled by the storage.database_type call
+         # below, in case you are wondering why they are missing.
          elif opt == '-l':
              state.proxyPorts = [_addressAndPort(arg)]



More information about the Spambayes-checkins mailing list