[Spambayes-checkins] spambayes/scripts sb_server.py,1.38,1.39

Tony Meyer anadelonbrin at users.sourceforge.net
Sun Jan 2 05:56:42 CET 2005


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

Modified Files:
	sb_server.py 
Log Message:
Prepare for i18n.

Index: sb_server.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/scripts/sb_server.py,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** sb_server.py	23 Dec 2004 18:14:32 -0000	1.38
--- sb_server.py	2 Jan 2005 04:56:40 -0000	1.39
***************
*** 116,120 ****
  from spambayes.FileCorpus import FileCorpus, ExpiryFileCorpus
  from spambayes.FileCorpus import FileMessageFactory, GzipFileMessageFactory
! from spambayes.Options import options, get_pathname_option
  from spambayes.UserInterface import UserInterfaceServer
  from spambayes.ProxyUI import ProxyUserInterface
--- 116,120 ----
  from spambayes.FileCorpus import FileCorpus, ExpiryFileCorpus
  from spambayes.FileCorpus import FileMessageFactory, GzipFileMessageFactory
! from spambayes.Options import options, get_pathname_option, _
  from spambayes.UserInterface import UserInterfaceServer
  from spambayes.ProxyUI import ProxyUserInterface
***************
*** 761,782 ****
              big = small = None
              if db_ratio > 5.0:
!                 big = "ham"
!                 small = "spam"
              elif db_ratio < (1/5.0):
!                 big = "spam"
!                 small = "ham"
!             if big is not None:
!                 self.warning = "Warning: you have much more %s than %s - " \
!                                "SpamBayes works best with approximately even " \
!                                "numbers of ham and spam." % (big, small)
              else:
                  self.warning = ""
          elif nspam > 0 or nham > 0:
!             self.warning = "Database only has %d good and %d spam - you should " \
!                            "consider performing additional training." % (nham, nspam)
          else:
!             self.warning = "Database has no training information.  SpamBayes " \
!                            "will classify all messages as 'unsure', " \
!                            "ready for you to train."
          # Add an additional warning message if the user's thresholds are
          # truly odd.
--- 761,783 ----
              big = small = None
              if db_ratio > 5.0:
!                 self.warning = _("Warning: you have much more ham than " \
!                                  "spam - SpamBayes works best with " \
!                                  "approximately even numbers of ham and " \
!                                  "spam.")
              elif db_ratio < (1/5.0):
!                 self.warning = _("Warning: you have much more spam than " \
!                                  "ham - SpamBayes works best with " \
!                                  "approximately even numbers of ham and " \
!                                  "spam.")
              else:
                  self.warning = ""
          elif nspam > 0 or nham > 0:
!             self.warning = _("Database only has %d good and %d spam - " \
!                              "you should consider performing additional " \
!                              "training.") % (nham, nspam)
          else:
!             self.warning = _("Database has no training information.  " \
!                              "SpamBayes will classify all messages as " \
!                              "'unsure', ready for you to train.")
          # Add an additional warning message if the user's thresholds are
          # truly odd.
***************
*** 784,796 ****
          ham_cut = options["Categorization", "ham_cutoff"]
          if spam_cut < 0.5:
!             self.warning += "<br/>Warning: we do not recommend setting " \
!                             "the spam threshold less than 0.5."
          if ham_cut > 0.5:
!             self.warning += "<br/>Warning: we do not recommend setting " \
!                             "the ham threshold greater than 0.5."
          if ham_cut > spam_cut:
!             self.warning += "<br/>Warning: your ham threshold is " \
!                             "<b>higher</b> than your spam threshold. " \
!                             "Results are unpredictable."
  
      def createWorkers(self):
--- 785,797 ----
          ham_cut = options["Categorization", "ham_cutoff"]
          if spam_cut < 0.5:
!             self.warning += _("<br/>Warning: we do not recommend " \
!                               "setting the spam threshold less than 0.5.")
          if ham_cut > 0.5:
!             self.warning += _("<br/>Warning: we do not recommend " \
!                               "setting the ham threshold greater than 0.5.")
          if ham_cut > spam_cut:
!             self.warning += _("<br/>Warning: your ham threshold is " \
!                               "<b>higher</b> than your spam threshold. " \
!                               "Results are unpredictable.")
  
      def createWorkers(self):
***************
*** 955,959 ****
      from urllib import urlopen, urlencode
      urlopen('http://localhost:%d/save' % state.uiPort,
!             urlencode({'how': 'Save & shutdown'})).read()
  
  
--- 956,960 ----
      from urllib import urlopen, urlencode
      urlopen('http://localhost:%d/save' % state.uiPort,
!             urlencode({'how': _('Save & shutdown')})).read()
  
  



More information about the Spambayes-checkins mailing list