Update of /cvsroot/spambayes/spambayes/contrib
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv5191

Modified Files:
        spamcounts.py 
Log Message:
Dump the -d and -p flags in favor of the more general -o flag.


Index: spamcounts.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/contrib/spamcounts.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** spamcounts.py       23 Apr 2006 22:30:46 -0000      1.7
--- spamcounts.py       6 Aug 2006 01:19:35 -0000       1.8
***************
*** 2,15 ****
  
  """
! Check spamcounts for various tokens or patterns
  
! usage %(prog)s [ -h ] [ -r ] [ -d db ] [ -p ] [ -t ] ...
  
  -h    - print this documentation and exit.
  -r    - treat tokens as regular expressions - may not be used with -t
- -d db - use db instead of the default found in the options file
- -p    - db is actually a pickle
  -t    - read message from stdin, tokenize it, then display their counts
          may not be used with -r
  """
  
--- 2,15 ----
  
  """
! Check spamcounts for one or more tokens or patterns
  
! usage %(prog)s [ options ] token ...
  
  -h    - print this documentation and exit.
  -r    - treat tokens as regular expressions - may not be used with -t
  -t    - read message from stdin, tokenize it, then display their counts
          may not be used with -r
+ -o section:option:value
+       - set [section, option] in the options database to value
  """
  
***************
*** 64,70 ****
  def main(args):
      try:
!         opts, args = getopt.getopt(args, "hrd:t",
!                                    ["help", "re", "database=", "pickle",
!                                     "tokenize"])
      except getopt.GetoptError, msg:
          usage(msg)
--- 64,69 ----
  def main(args):
      try:
!         opts, args = getopt.getopt(args, "hrto:",
!                                    ["help", "re", "tokenize", "option="])
      except getopt.GetoptError, msg:
          usage(msg)
***************
*** 72,77 ****
  
      usere = False
-     dbname = get_pathname_option("Storage", "persistent_storage_file")
-     ispickle = not options["Storage", "persistent_use_database"]
      tokenizestdin = False
      for opt, arg in opts:
--- 71,74 ----
***************
*** 79,90 ****
              usage()
              return 0
-         elif opt in ("-d", "--database"):
-             dbname = arg
          elif opt in ("-r", "--re"):
              usere = True
-         elif opt in ("-p", "--pickle"):
-             ispickle = True
          elif opt in ("-t", "--tokenize"):
              tokenizestdin = True
  
      if usere and tokenizestdin:
--- 76,85 ----
              usage()
              return 0
          elif opt in ("-r", "--re"):
              usere = True
          elif opt in ("-t", "--tokenize"):
              tokenizestdin = True
+         elif opt in ('-o', '--option'):
+             options.set_from_cmdline(arg, sys.stderr)
  
      if usere and tokenizestdin:

_______________________________________________
Spambayes-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/spambayes-checkins

Reply via email to